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 aDurationFormatSettingsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the value of theamountOfUnitsToShowrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thelastSeparatorrecord component.Returns the value of theseparatorrecord component.booleanReturns the value of theshowZeroValuesrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thetranslationsrecord component.
-
Constructor Details
-
DurationFormatSettings
public DurationFormatSettings(Map<TimeUnit, DurationUtils.DurationFormatSettings.TimeUnitTranslation> translations, String separator, String lastSeparator, long amountOfUnitsToShow, boolean showZeroValues) Creates an instance of aDurationFormatSettingsrecord class.- Parameters:
translations- the value for thetranslationsrecord componentseparator- the value for theseparatorrecord componentlastSeparator- the value for thelastSeparatorrecord componentamountOfUnitsToShow- the value for theamountOfUnitsToShowrecord componentshowZeroValues- the value for theshowZeroValuesrecord 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 thetranslationsrecord component.- Returns:
- the value of the
translationsrecord component
-
separator
Returns the value of theseparatorrecord component.- Returns:
- the value of the
separatorrecord component
-
lastSeparator
Returns the value of thelastSeparatorrecord component.- Returns:
- the value of the
lastSeparatorrecord component
-
amountOfUnitsToShow
public long amountOfUnitsToShow()Returns the value of theamountOfUnitsToShowrecord component.- Returns:
- the value of the
amountOfUnitsToShowrecord component
-
showZeroValues
public boolean showZeroValues()Returns the value of theshowZeroValuesrecord component.- Returns:
- the value of the
showZeroValuesrecord component
-