Record Class BetweenDistanceConstraint
java.lang.Object
java.lang.Record
net.amygdalum.allotropy.fluent.distances.BetweenDistanceConstraint
- All Implemented Interfaces:
Predicate<Distance>,Constraint<Distance>,DistanceConstraint,Precisable<DistanceConstraint>
public record BetweenDistanceConstraint(Precision precision, Distance from, Distance to)
extends Record
implements DistanceConstraint
-
Field Summary
Fields inherited from interface net.amygdalum.allotropy.fluent.distances.DistanceConstraint
NONE -
Constructor Summary
ConstructorsConstructorDescriptionBetweenDistanceConstraint(Precision precision, Distance from, Distance to) Creates an instance of aBetweenDistanceConstraintrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic BetweenDistanceConstraintfinal booleanIndicates whether some other object is "equal to" this one.from()Returns the value of thefromrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of theprecisionrecord component.booleanto()Returns the value of thetorecord component.final StringtoString()Returns a string representation of this record class.withPrecision(Precision precision)
-
Constructor Details
-
BetweenDistanceConstraint
Creates an instance of aBetweenDistanceConstraintrecord class.- Parameters:
precision- the value for theprecisionrecord componentfrom- the value for thefromrecord componentto- the value for thetorecord component
-
-
Method Details
-
between
-
test
-
withPrecision
- Specified by:
withPrecisionin interfacePrecisable<DistanceConstraint>
-
description
- Specified by:
descriptionin interfaceConstraint<Distance>
-
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 withObjects::equals(Object,Object). -
precision
Returns the value of theprecisionrecord component.- Returns:
- the value of the
precisionrecord component
-
from
Returns the value of thefromrecord component.- Returns:
- the value of the
fromrecord component
-
to
Returns the value of thetorecord component.- Returns:
- the value of the
torecord component
-