diff --git a/archunit/src/main/java/com/tngtech/archunit/library/cycle_detection/Cycle.java b/archunit/src/main/java/com/tngtech/archunit/library/cycle_detection/Cycle.java index 909ddedfc..9d283cd62 100644 --- a/archunit/src/main/java/com/tngtech/archunit/library/cycle_detection/Cycle.java +++ b/archunit/src/main/java/com/tngtech/archunit/library/cycle_detection/Cycle.java @@ -19,6 +19,7 @@ import com.tngtech.archunit.PublicAPI; +import static com.tngtech.archunit.PublicAPI.State.EXPERIMENTAL; import static com.tngtech.archunit.PublicAPI.Usage.ACCESS; /** @@ -29,12 +30,12 @@ * * @param The type of the edges forming the cycle */ -@PublicAPI(usage = ACCESS) +@PublicAPI(usage = ACCESS, state = EXPERIMENTAL) public interface Cycle> { /** * @return The edges of the {@link Cycle} */ - @PublicAPI(usage = ACCESS) + @PublicAPI(usage = ACCESS, state = EXPERIMENTAL) List getEdges(); } diff --git a/archunit/src/main/java/com/tngtech/archunit/library/cycle_detection/CycleDetector.java b/archunit/src/main/java/com/tngtech/archunit/library/cycle_detection/CycleDetector.java index 68bc6ef3f..6b07212fa 100644 --- a/archunit/src/main/java/com/tngtech/archunit/library/cycle_detection/CycleDetector.java +++ b/archunit/src/main/java/com/tngtech/archunit/library/cycle_detection/CycleDetector.java @@ -19,12 +19,13 @@ import com.tngtech.archunit.PublicAPI; +import static com.tngtech.archunit.PublicAPI.State.EXPERIMENTAL; import static com.tngtech.archunit.PublicAPI.Usage.ACCESS; /** * @see #detectCycles(Collection, Collection) */ -@PublicAPI(usage = ACCESS) +@PublicAPI(usage = ACCESS, state = EXPERIMENTAL) public final class CycleDetector { private CycleDetector() { } @@ -51,7 +52,7 @@ private CycleDetector() { * @param edges The edges connecting the nodes of the graph * @return All cycles within the graph created from the passed nodes and edges. */ - @PublicAPI(usage = ACCESS) + @PublicAPI(usage = ACCESS, state = EXPERIMENTAL) public static > Cycles detectCycles(Collection nodes, Collection edges) { Graph graph = new Graph<>(); graph.addNodes(nodes); diff --git a/archunit/src/main/java/com/tngtech/archunit/library/cycle_detection/Cycles.java b/archunit/src/main/java/com/tngtech/archunit/library/cycle_detection/Cycles.java index 658ef4807..c51ca759d 100644 --- a/archunit/src/main/java/com/tngtech/archunit/library/cycle_detection/Cycles.java +++ b/archunit/src/main/java/com/tngtech/archunit/library/cycle_detection/Cycles.java @@ -19,9 +19,10 @@ import com.tngtech.archunit.PublicAPI; +import static com.tngtech.archunit.PublicAPI.State.EXPERIMENTAL; import static com.tngtech.archunit.PublicAPI.Usage.ACCESS; -@PublicAPI(usage = ACCESS) +@PublicAPI(usage = ACCESS, state = EXPERIMENTAL) public interface Cycles> extends Collection> { /** @@ -31,6 +32,6 @@ public interface Cycles> extends Collection> { * The maximum number of cycles at which the algorithm will stop can be configured by the {@code archunit.properties} * property {@value CycleConfiguration#MAX_NUMBER_OF_CYCLES_TO_DETECT_PROPERTY_NAME}. */ - @PublicAPI(usage = ACCESS) + @PublicAPI(usage = ACCESS, state = EXPERIMENTAL) boolean maxNumberOfCyclesReached(); } diff --git a/archunit/src/main/java/com/tngtech/archunit/library/cycle_detection/Edge.java b/archunit/src/main/java/com/tngtech/archunit/library/cycle_detection/Edge.java index a5131df60..72d5aa112 100644 --- a/archunit/src/main/java/com/tngtech/archunit/library/cycle_detection/Edge.java +++ b/archunit/src/main/java/com/tngtech/archunit/library/cycle_detection/Edge.java @@ -17,6 +17,7 @@ import com.tngtech.archunit.PublicAPI; +import static com.tngtech.archunit.PublicAPI.State.EXPERIMENTAL; import static com.tngtech.archunit.PublicAPI.Usage.ACCESS; import static com.tngtech.archunit.PublicAPI.Usage.INHERITANCE; @@ -27,7 +28,7 @@ public interface Edge { NODE getTarget(); - @PublicAPI(usage = ACCESS) + @PublicAPI(usage = ACCESS, state = EXPERIMENTAL) static Edge create(N origin, N target) { return new SimpleEdge<>(origin, target); } diff --git a/archunit/src/main/java/com/tngtech/archunit/library/cycle_detection/rules/CycleArchCondition.java b/archunit/src/main/java/com/tngtech/archunit/library/cycle_detection/rules/CycleArchCondition.java index 549b8e8c1..ed10129af 100644 --- a/archunit/src/main/java/com/tngtech/archunit/library/cycle_detection/rules/CycleArchCondition.java +++ b/archunit/src/main/java/com/tngtech/archunit/library/cycle_detection/rules/CycleArchCondition.java @@ -49,6 +49,7 @@ import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.collect.ImmutableSet.toImmutableSet; import static com.google.common.collect.MultimapBuilder.hashKeys; +import static com.tngtech.archunit.PublicAPI.State.EXPERIMENTAL; import static com.tngtech.archunit.PublicAPI.Usage.ACCESS; import static com.tngtech.archunit.library.cycle_detection.CycleConfiguration.MAX_NUMBER_OF_CYCLES_TO_DETECT_PROPERTY_NAME; import static com.tngtech.archunit.library.cycle_detection.rules.CycleRuleConfiguration.MAX_NUMBER_OF_DEPENDENCIES_TO_SHOW_PER_EDGE_PROPERTY_NAME; @@ -63,7 +64,7 @@ * * @param The type of the component to check dependencies between */ -@PublicAPI(usage = ACCESS) +@PublicAPI(usage = ACCESS, state = EXPERIMENTAL) public final class CycleArchCondition extends ArchCondition { private static final Logger log = LoggerFactory.getLogger(CycleArchCondition.class); @@ -297,12 +298,12 @@ private List dependenciesDescription(ComponentDependency edge } } - @PublicAPI(usage = ACCESS) + @PublicAPI(usage = ACCESS, state = EXPERIMENTAL) public static NeedsRetrieveClasses builder() { return new Builder<>(); } - @PublicAPI(usage = ACCESS) + @PublicAPI(usage = ACCESS, state = EXPERIMENTAL) public static final class Builder implements NeedsRetrieveClasses, NeedsRetrieveDescription, NeedsRetrieveOutgoingDependencies { private Function> retrieveClasses; private Function retrieveDescription; @@ -333,7 +334,7 @@ public Builder retrieveOutgoingDependenciesBy(Function onlyConsiderDependencies(Predicate relevantClassDependenciesPredicate) { this.relevantClassDependenciesPredicate = checkNotNull(relevantClassDependenciesPredicate); return this; @@ -342,36 +343,36 @@ public Builder onlyConsiderDependencies(Predicate /** * @return A new {@link CycleArchCondition} */ - @PublicAPI(usage = ACCESS) + @PublicAPI(usage = ACCESS, state = EXPERIMENTAL) public CycleArchCondition build() { return new CycleArchCondition<>(retrieveClasses, retrieveDescription, retrieveOutgoingDependencies, relevantClassDependenciesPredicate); } } - @PublicAPI(usage = ACCESS) + @PublicAPI(usage = ACCESS, state = EXPERIMENTAL) public interface NeedsRetrieveClasses { /** * @param retrieveClasses A {@link Function} to retrieve the contained {@link JavaClass classes} for any given {@code COMPONENT} */ - @PublicAPI(usage = ACCESS) + @PublicAPI(usage = ACCESS, state = EXPERIMENTAL) NeedsRetrieveDescription retrieveClassesBy(Function> retrieveClasses); } - @PublicAPI(usage = ACCESS) + @PublicAPI(usage = ACCESS, state = EXPERIMENTAL) public interface NeedsRetrieveDescription { /** * @param retrieveDescription A {@link Function} to retrieve the description of a {@code COMPONENT} */ - @PublicAPI(usage = ACCESS) + @PublicAPI(usage = ACCESS, state = EXPERIMENTAL) NeedsRetrieveOutgoingDependencies retrieveDescriptionBy(Function retrieveDescription); } - @PublicAPI(usage = ACCESS) + @PublicAPI(usage = ACCESS, state = EXPERIMENTAL) public interface NeedsRetrieveOutgoingDependencies { /** * @param retrieveOutgoingDependencies A {@link Function} to retrieve the outgoing {@link Dependency dependencies} of a {@code COMPONENT} */ - @PublicAPI(usage = ACCESS) + @PublicAPI(usage = ACCESS, state = EXPERIMENTAL) Builder retrieveOutgoingDependenciesBy(Function> retrieveOutgoingDependencies); } }