Record Class PresenceConstraint
java.lang.Object
java.lang.Record
net.amygdalum.allotropy.fluent.conditions.PresenceConstraint
- All Implemented Interfaces:
Predicate<VisualElement>,Constraint<VisualElement>
public record PresenceConstraint(boolean present)
extends Record
implements Constraint<VisualElement>
-
Constructor Summary
ConstructorsConstructorDescriptionPresenceConstraint(boolean present) Creates an instance of aPresenceConstraintrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static PresenceConstraintisAbsent()static PresenceConstraintbooleanpresent()Returns the value of thepresentrecord component.booleanfinal StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PresenceConstraint
public PresenceConstraint(boolean present) Creates an instance of aPresenceConstraintrecord class.- Parameters:
present- the value for thepresentrecord component
-
-
Method Details
-
test
- Specified by:
testin interfacePredicate<VisualElement>
-
description
- Specified by:
descriptionin interfaceConstraint<VisualElement>
-
isPresent
-
isAbsent
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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 with '=='. -
present
public boolean present()Returns the value of thepresentrecord component.- Returns:
- the value of the
presentrecord component
-