Record Class AnnotationValueCondition
java.lang.Object
java.lang.Record
dev.archunitjava.rules.AnnotationValueCondition
- All Implemented Interfaces:
Comparable<AnnotationValueCondition>
public record AnnotationValueCondition(String elementName, AnnotationValueOperator operator, Optional<JavaAnnotationValue> expectedValue)
extends Record
implements Comparable<AnnotationValueCondition>
One typed condition over an explicitly encoded annotation element.
-
Constructor Summary
ConstructorsConstructorDescriptionAnnotationValueCondition(String elementName, AnnotationValueOperator operator, Optional<JavaAnnotationValue> expectedValue) Creates an instance of aAnnotationValueConditionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic AnnotationValueConditionintReturns the value of theelementNamerecord component.final booleanIndicates whether some other object is "equal to" this one.static AnnotationValueConditionequalTo(String elementName, JavaAnnotationValue value) Returns the value of theexpectedValuerecord component.final inthashCode()Returns a hash code value for this object.booleanmatches(JavaAnnotation annotation) static AnnotationValueConditionnotEqualTo(String elementName, JavaAnnotationValue value) operator()Returns the value of theoperatorrecord component.static AnnotationValueConditionfinal StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
AnnotationValueCondition
public AnnotationValueCondition(String elementName, AnnotationValueOperator operator, Optional<JavaAnnotationValue> expectedValue) Creates an instance of aAnnotationValueConditionrecord class.- Parameters:
elementName- the value for theelementNamerecord componentoperator- the value for theoperatorrecord componentexpectedValue- the value for theexpectedValuerecord component
-
-
Method Details
-
present
-
absent
-
equalTo
-
notEqualTo
-
matches
-
stableKey
-
compareTo
- Specified by:
compareToin interfaceComparable<AnnotationValueCondition>
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
elementName
Returns the value of theelementNamerecord component.- Returns:
- the value of the
elementNamerecord component
-
operator
Returns the value of theoperatorrecord component.- Returns:
- the value of the
operatorrecord component
-
expectedValue
Returns the value of theexpectedValuerecord component.- Returns:
- the value of the
expectedValuerecord component
-