Record Class QualityIndicator<T>

java.lang.Object
java.lang.Record
de.chojo.universalis.entities.QualityIndicator<T>
Type Parameters:
T - type of indicator data
Record Components:
general - general data
normalQuality - normal quality data
highQuality - high quality data

public record QualityIndicator<T>(T general, T normalQuality, T highQuality) extends Record
Indicator for providing data based on the quality of an item
  • Constructor Summary

    Constructors
    Constructor
    Description
    QualityIndicator(T general, T normalQuality, T highQuality)
    Creates an instance of a QualityIndicator record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    Returns the value of the general record component.
    final int
    Returns a hash code value for this object.
    Returns the value of the highQuality record component.
    Returns the value of the normalQuality record component.
    static <T> QualityIndicator<T>
    of(T general, T normalQuality, T highQuality)
    Create a new quality indicator
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

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

    • QualityIndicator

      public QualityIndicator(T general, T normalQuality, T highQuality)
      Creates an instance of a QualityIndicator record class.
      Parameters:
      general - the value for the general record component
      normalQuality - the value for the normalQuality record component
      highQuality - the value for the highQuality record component
  • Method Details

    • of

      public static <T> QualityIndicator<T> of(T general, T normalQuality, T highQuality)
      Create a new quality indicator
      Type Parameters:
      T - type of indicator data
      Parameters:
      general - general data
      normalQuality - normal quality data
      highQuality - high quality data
      Returns:
      new indicator
    • 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 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.
    • general

      public T general()
      Returns the value of the general record component.
      Returns:
      the value of the general record component
    • normalQuality

      public T normalQuality()
      Returns the value of the normalQuality record component.
      Returns:
      the value of the normalQuality record component
    • highQuality

      public T highQuality()
      Returns the value of the highQuality record component.
      Returns:
      the value of the highQuality record component