Record Class PropertyHints

java.lang.Object
java.lang.Record
com.wualabs.qtsurfer.engine.core.PropertyHints
Record Components:
min - the suggested minimum, or Double.NaN if unset
max - the suggested maximum, or Double.NaN if unset
step - the suggested step/resolution, or Double.NaN if unset

public record PropertyHints(double min, double max, double step) extends Record
Optional numeric range hints for a PropertyInfo: a suggested minimum, maximum and step for the property value. These are purely advisory metadata consumed by callers that introspect sweepable properties (parameter sweeps, UI range pre-fills); they do not constrain or validate the property value.

A hint is "present" when it is a finite number. The sentinel for an absent hint is Double.NaN, which lets every existing annotation/registration keep working without specifying hints. Use NONE for "no hints".

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final PropertyHints
    Shared instance representing the absence of any hint.
  • Constructor Summary

    Constructors
    Constructor
    Description
    PropertyHints(double min, double max, double step)
    Creates an instance of a PropertyHints record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    boolean
     
    boolean
     
    boolean
     
    boolean
    True if none of the three hints is present.
    double
    max()
    Returns the value of the max record component.
    double
    min()
    Returns the value of the min record component.
    of(double min, double max, double step)
    Builds a PropertyHints, normalizing to the shared NONE instance when no hint is present (all three values absent).
    double
    Returns the value of the step record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • NONE

      public static final PropertyHints NONE
      Shared instance representing the absence of any hint.
  • Constructor Details

    • PropertyHints

      public PropertyHints(double min, double max, double step)
      Creates an instance of a PropertyHints record class.
      Parameters:
      min - the value for the min record component
      max - the value for the max record component
      step - the value for the step record component
  • Method Details

    • of

      public static PropertyHints of(double min, double max, double step)
      Builds a PropertyHints, normalizing to the shared NONE instance when no hint is present (all three values absent).
    • isEmpty

      public boolean isEmpty()
      True if none of the three hints is present.
    • hasMin

      public boolean hasMin()
    • hasMax

      public boolean hasMax()
    • hasStep

      public boolean hasStep()
    • toString

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

      public final boolean equals(Object o)
      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 the compare method from their corresponding wrapper classes.
      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 double min()
      Returns the value of the min record component.
      Returns:
      the value of the min record component
    • max

      public double max()
      Returns the value of the max record component.
      Returns:
      the value of the max record component
    • step

      public double step()
      Returns the value of the step record component.
      Returns:
      the value of the step record component