java.lang.Object
de.powerstat.validation.values.Minute
- All Implemented Interfaces:
IValueObject
,Comparable<Minute>
Minute.
Not DSGVO relevant.
TODO Listener
TODO secondsWithin = 60
TODO min, max
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdd minutes to this minute.int
Compare with another object.Decrement this minute.boolean
Is equal with another object.int
hashCode()
Calculate hash code.Increment this minute.int
intValue()
Returns the value of this Minute as an int.static Minute
of
(int minute) Minute factory.static Minute
Minute factory.Returns the value of this Minute as an String.Subtract minutes from this minute.toString()
Returns the string representation of this Minute.
-
Field Details
-
OVERFLOW
Overlfow constant.- See Also:
-
UNDERFLOW
Underflow constant.- See Also:
-
minute
private final int minuteMinute.
-
-
Constructor Details
-
Minute
private Minute(int minute) Constructor.- Parameters:
minute
- Minute 0-59- Throws:
IndexOutOfBoundsException
- When the minute is less than 0 or greater than 59
-
-
Method Details
-
of
Minute factory.- Parameters:
minute
- Minute 0-59- Returns:
- Minute object
-
of
Minute factory.- Parameters:
value
- Minute 0-59 string- Returns:
- Minute object
-
intValue
public int intValue()Returns the value of this Minute as an int.- Returns:
- The numeric value represented by this object after conversion to type int.
-
stringValue
Returns the value of this Minute as an String.- Specified by:
stringValue
in interfaceIValueObject
- Returns:
- The numeric value represented by this object after conversion to type String.
-
hashCode
public int hashCode()Calculate hash code. -
equals
Is equal with another object. -
toString
Returns the string representation of this Minute. The exact details of this representation are unspecified and subject to change, but the following may be regarded as typical: "Minute[minute=1]" -
compareTo
Compare with another object.- Specified by:
compareTo
in interfaceComparable<Minute>
- Parameters:
obj
- Object to compare with- Returns:
- 0: equal; 1: greater; -1: smaller
- See Also:
-
add
Add minutes to this minute.- Parameters:
minutes
- Minutes to add to this minute- Returns:
- New minute after adding the minutes to this minute
- Throws:
ArithmeticException
- In case of an overflow
-
subtract
Subtract minutes from this minute.- Parameters:
minutes
- Minutes to subtract from this minute- Returns:
- New minute after subtracting minutes from this minute
- Throws:
ArithmeticException
- In case of an underflow
-
increment
Increment this minute.- Returns:
- New minute after incrementing this minute
- Throws:
ArithmeticException
- In case of an overflow
-
decrement
Decrement this minute.- Returns:
- New minute after decrement this minute
- Throws:
ArithmeticException
- In case of an overflow
-