java.lang.Object
java.lang.Record
com.amirali.fxdialogs.Time
- Record Components:
hours
- hoursminutes
- minutesam_pm
- am_pm
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionTime
(int hours, int minutes, Time.AM_PM am_pm) checks if (hour is more than 12 or less than 0) and (minute is more than 59 or less than 0), sets hours or minutes to 0 if it's true -
Method Summary
Modifier and TypeMethodDescriptionam_pm()
Returns the value of theam_pm
record component.final boolean
Indicates whether some other object is "equal to" this one.static Time
current timefinal int
hashCode()
Returns a hash code value for this object.int
hours()
Returns the value of thehours
record component.int
minutes()
Returns the value of theminutes
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
Time
checks if (hour is more than 12 or less than 0) and (minute is more than 59 or less than 0), sets hours or minutes to 0 if it's true- Parameters:
hours
- hoursminutes
- minutesam_pm
- am_pm
-
-
Method Details
-
getCurrentTime
current time- Returns:
- Time
-
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 '=='. -
hours
public int hours()Returns the value of thehours
record component.- Returns:
- the value of the
hours
record component
-
minutes
public int minutes()Returns the value of theminutes
record component.- Returns:
- the value of the
minutes
record component
-
am_pm
Returns the value of theam_pm
record component.- Returns:
- the value of the
am_pm
record component
-