Record Class Range
java.lang.Object
java.lang.Record
com.github.minecraftschurlimods.arsmagicalegacy.api.util.Range
- All Implemented Interfaces:
DoublePredicate
@Deprecated(forRemoval=true,
since="1.1.0")
public record Range(Optional<Double> min, Optional<Double> max)
extends Record
implements DoublePredicate
Deprecated, for removal: This API element is subject to removal in a future version.
A double range with inclusive upper and lower bounds.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanDeprecated, for removal: This API element is subject to removal in a future version.Indicates whether some other object is "equal to" this one.final inthashCode()Deprecated, for removal: This API element is subject to removal in a future version.Returns a hash code value for this object.booleanDeprecated, for removal: This API element is subject to removal in a future version.booleanDeprecated, for removal: This API element is subject to removal in a future version.max()Deprecated, for removal: This API element is subject to removal in a future version.Returns the value of themaxrecord component.min()Deprecated, for removal: This API element is subject to removal in a future version.Returns the value of theminrecord component.static RangeofBounds(double min, double max) Deprecated, for removal: This API element is subject to removal in a future version.Creates a range with a lower and upper bound.static RangeofLowerBound(double min) Deprecated, for removal: This API element is subject to removal in a future version.Creates a range with a lower bound.static RangeofUpperBound(double max) Deprecated, for removal: This API element is subject to removal in a future version.Creates a range with an upper bound.booleantest(double value) Deprecated, for removal: This API element is subject to removal in a future version.final StringtoString()Deprecated, for removal: This API element is subject to removal in a future version.Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.function.DoublePredicate
and, negate, or
-
Field Details
-
CODEC
Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Constructor Details
-
Range
Deprecated, for removal: This API element is subject to removal in a future version.Creates an instance of aRangerecord class.- Parameters:
min- the value for theminrecord componentmax- the value for themaxrecord component
-
-
Method Details
-
ofBounds
Deprecated, for removal: This API element is subject to removal in a future version.Creates a range with a lower and upper bound.- Parameters:
min- the minimum value for the range.max- the maximum value for the range.- Returns:
- A range with a lower bound of min and an upper bound of max.
-
ofLowerBound
Deprecated, for removal: This API element is subject to removal in a future version.Creates a range with a lower bound.- Parameters:
min- the minimum value for the range.- Returns:
- A range with a lower bound of min and no upper bound.
-
ofUpperBound
Deprecated, for removal: This API element is subject to removal in a future version.Creates a range with an upper bound.- Parameters:
max- the maximum value for the range.- Returns:
- A range with an upper bound of max and no lower bound.
-
hasLowerBound
public boolean hasLowerBound()Deprecated, for removal: This API element is subject to removal in a future version.- Returns:
- Whether this range has a lower bound or not.
-
hasUpperBound
public boolean hasUpperBound()Deprecated, for removal: This API element is subject to removal in a future version.- Returns:
- Whether this range has an upper bound or not.
-
test
public boolean test(double value) Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
testin interfaceDoublePredicate
-
toString
Deprecated, for removal: This API element is subject to removal in a future version.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()Deprecated, for removal: This API element is subject to removal in a future version.Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Deprecated, for removal: This API element is subject to removal in a future version.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). -
min
Deprecated, for removal: This API element is subject to removal in a future version.Returns the value of theminrecord component.- Returns:
- the value of the
minrecord component
-
max
Deprecated, for removal: This API element is subject to removal in a future version.Returns the value of themaxrecord component.- Returns:
- the value of the
maxrecord component
-
MinMaxBounds.Doublesinstead.