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.
Use MinMaxBounds.Doubles instead.
A double range with inclusive upper and lower bounds.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static com.mojang.serialization.Codec<Range>
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
    Creates an instance of a Range record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Indicates whether some other object is "equal to" this one.
    final int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns a hash code value for this object.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    boolean
    Deprecated, 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 the max record component.
    min()
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the value of the min record component.
    static Range
    ofBounds(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 Range
    ofLowerBound(double min)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Creates a range with a lower bound.
    static Range
    ofUpperBound(double max)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Creates a range with an upper bound.
    boolean
    test(double value)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    final String
    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, wait

    Methods inherited from interface java.util.function.DoublePredicate

    and, negate, or
  • Field Details

    • CODEC

      public static com.mojang.serialization.Codec<Range> CODEC
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Constructor Details

    • Range

      public Range(Optional<Double> min, Optional<Double> max)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates an instance of a Range record class.
      Parameters:
      min - the value for the min record component
      max - the value for the max record component
  • Method Details

    • ofBounds

      public static Range ofBounds(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.
      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

      public static Range ofLowerBound(double min)
      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

      public static Range ofUpperBound(double max)
      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:
      test in interface DoublePredicate
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • min

      public Optional<Double> min()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the value of the min record component.
      Returns:
      the value of the min record component
    • max

      public Optional<Double> max()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the value of the max record component.
      Returns:
      the value of the max record component