java.lang.Object
com.azure.resourcemanager.storagemover.models.Time
All Implemented Interfaces:
com.azure.json.JsonSerializable<Time>

public final class Time extends Object implements com.azure.json.JsonSerializable<Time>
The time of day.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an instance of Time class.
  • Method Summary

    Modifier and Type
    Method
    Description
    static Time
    fromJson(com.azure.json.JsonReader jsonReader)
    Reads an instance of Time from the JsonReader.
    int
    Get the hour property: The hour element of the time.
    Get the minute property: The minute element of the time.
    com.azure.json.JsonWriter
    toJson(com.azure.json.JsonWriter jsonWriter)
    void
    Validates the instance.
    withHour(int hour)
    Set the hour property: The hour element of the time.
    Set the minute property: The minute element of the time.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.azure.json.JsonSerializable

    toJson, toJson, toJsonBytes, toJsonString
  • Constructor Details

    • Time

      public Time()
      Creates an instance of Time class.
  • Method Details

    • hour

      public int hour()
      Get the hour property: The hour element of the time. Allowed values range from 0 (start of the selected day) to 24 (end of the selected day). Hour value 24 cannot be combined with any other minute value but 0.
      Returns:
      the hour value.
    • withHour

      public Time withHour(int hour)
      Set the hour property: The hour element of the time. Allowed values range from 0 (start of the selected day) to 24 (end of the selected day). Hour value 24 cannot be combined with any other minute value but 0.
      Parameters:
      hour - the hour value to set.
      Returns:
      the Time object itself.
    • minute

      public Minute minute()
      Get the minute property: The minute element of the time. Allowed values are 0 and 30. If not specified, its value defaults to 0.
      Returns:
      the minute value.
    • withMinute

      public Time withMinute(Minute minute)
      Set the minute property: The minute element of the time. Allowed values are 0 and 30. If not specified, its value defaults to 0.
      Parameters:
      minute - the minute value to set.
      Returns:
      the Time object itself.
    • validate

      public void validate()
      Validates the instance.
      Throws:
      IllegalArgumentException - thrown if the instance is not valid.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<Time>
      Throws:
      IOException
    • fromJson

      public static Time fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of Time from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of Time if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
      Throws:
      IllegalStateException - If the deserialized JSON object was missing any required properties.
      IOException - If an error occurs while reading the Time.