Package io.github.jtwitch.command.type
Record Class TimeUnit
java.lang.Object
java.lang.Record
io.github.jtwitch.command.type.TimeUnit
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Indicates whether some other object is "equal to" this one.int
hashCode()
Returns a hash code value for this object.int
time()
Returns the value of thetime
record component.toString()
Returns a string representation of this record class.unit()
Returns the value of theunit
record component.
-
Constructor Details
-
TimeUnit
Creates an instance of aTimeUnit
record class.- Parameters:
time
- the value for thetime
record componentunit
- the value for theunit
record component
-
-
Method Details
-
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 '=='. -
time
public int time()Returns the value of thetime
record component.- Returns:
- the value of the
time
record component
-
unit
Returns the value of theunit
record component.- Returns:
- the value of the
unit
record component
-