Package de.chojo.universalis.entities
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 datanormalQuality
- normal quality datahighQuality
- high quality data
Indicator for providing data based on the quality of an item
-
Constructor Summary
ConstructorsConstructorDescriptionQualityIndicator
(T general, T normalQuality, T highQuality) Creates an instance of aQualityIndicator
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.general()
Returns the value of thegeneral
record component.final int
hashCode()
Returns a hash code value for this object.Returns the value of thehighQuality
record component.Returns the value of thenormalQuality
record component.static <T> QualityIndicator<T>
of
(T general, T normalQuality, T highQuality) Create a new quality indicatorfinal String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
QualityIndicator
Creates an instance of aQualityIndicator
record class.- Parameters:
general
- the value for thegeneral
record componentnormalQuality
- the value for thenormalQuality
record componenthighQuality
- the value for thehighQuality
record component
-
-
Method Details
-
of
Create a new quality indicator- Type Parameters:
T
- type of indicator data- Parameters:
general
- general datanormalQuality
- normal quality datahighQuality
- high quality data- Returns:
- new indicator
-
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)
. -
general
Returns the value of thegeneral
record component.- Returns:
- the value of the
general
record component
-
normalQuality
Returns the value of thenormalQuality
record component.- Returns:
- the value of the
normalQuality
record component
-
highQuality
Returns the value of thehighQuality
record component.- Returns:
- the value of the
highQuality
record component
-