java.lang.Object
de.powerstat.validation.values.Minute
All Implemented Interfaces:
IValueObject, Comparable<Minute>

public final class Minute extends Object implements Comparable<Minute>, IValueObject
Minute. Not DSGVO relevant. TODO Listener TODO secondsWithin = 60 TODO min, max
  • Field Details

  • 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

      public static Minute of(int minute)
      Minute factory.
      Parameters:
      minute - Minute 0-59
      Returns:
      Minute object
    • of

      public static Minute of(String value)
      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

      public String stringValue()
      Returns the value of this Minute as an String.
      Specified by:
      stringValue in interface IValueObject
      Returns:
      The numeric value represented by this object after conversion to type String.
    • hashCode

      public int hashCode()
      Calculate hash code.
      Overrides:
      hashCode in class Object
      Returns:
      Hash
      See Also:
    • equals

      public boolean equals(Object obj)
      Is equal with another object.
      Overrides:
      equals in class Object
      Parameters:
      obj - Object
      Returns:
      true when equal, false otherwise
      See Also:
    • toString

      public String 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]"
      Overrides:
      toString in class Object
      Returns:
      String representation of this Minute
      See Also:
    • compareTo

      public int compareTo(Minute obj)
      Compare with another object.
      Specified by:
      compareTo in interface Comparable<Minute>
      Parameters:
      obj - Object to compare with
      Returns:
      0: equal; 1: greater; -1: smaller
      See Also:
    • add

      public Minute add(Minutes minutes)
      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

      public Minute subtract(Minutes minutes)
      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

      public Minute increment()
      Increment this minute.
      Returns:
      New minute after incrementing this minute
      Throws:
      ArithmeticException - In case of an overflow
    • decrement

      public Minute decrement()
      Decrement this minute.
      Returns:
      New minute after decrement this minute
      Throws:
      ArithmeticException - In case of an overflow