Package dev.chicoferreira.lifestealer
Record Class DurationUtils.DurationFormatSettings
java.lang.Object
java.lang.Record
dev.chicoferreira.lifestealer.DurationUtils.DurationFormatSettings
- Enclosing class:
DurationUtils
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
-
Constructor Summary
ConstructorsConstructorDescriptionDurationFormatSettings
(Map<TimeUnit, DurationUtils.DurationFormatSettings.TimeUnitTranslation> translations, String separator, String lastSeparator, long amountOfUnitsToShow, boolean showZeroValues) Creates an instance of aDurationFormatSettings
record class. -
Method Summary
Modifier and TypeMethodDescriptionlong
Returns the value of theamountOfUnitsToShow
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of thelastSeparator
record component.Returns the value of theseparator
record component.boolean
Returns the value of theshowZeroValues
record component.final String
toString()
Returns a string representation of this record class.Returns the value of thetranslations
record component.
-
Constructor Details
-
DurationFormatSettings
public DurationFormatSettings(Map<TimeUnit, DurationUtils.DurationFormatSettings.TimeUnitTranslation> translations, String separator, String lastSeparator, long amountOfUnitsToShow, boolean showZeroValues) Creates an instance of aDurationFormatSettings
record class.- Parameters:
translations
- the value for thetranslations
record componentseparator
- the value for theseparator
record componentlastSeparator
- the value for thelastSeparator
record componentamountOfUnitsToShow
- the value for theamountOfUnitsToShow
record componentshowZeroValues
- the value for theshowZeroValues
record component
-
-
Method Details
-
format
-
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. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
translations
Returns the value of thetranslations
record component.- Returns:
- the value of the
translations
record component
-
separator
Returns the value of theseparator
record component.- Returns:
- the value of the
separator
record component
-
lastSeparator
Returns the value of thelastSeparator
record component.- Returns:
- the value of the
lastSeparator
record component
-
amountOfUnitsToShow
public long amountOfUnitsToShow()Returns the value of theamountOfUnitsToShow
record component.- Returns:
- the value of the
amountOfUnitsToShow
record component
-
showZeroValues
public boolean showZeroValues()Returns the value of theshowZeroValues
record component.- Returns:
- the value of the
showZeroValues
record component
-