Class Humidity

java.lang.Object
com.github.prominence.openweathermap.api.model.Humidity

public class Humidity extends Object
The Humidity type represents humidity value percentage. Its value can only be an integer in [0, 100] range.
  • Method Details

    • withValue

      public static Humidity withValue(byte value)
      Creates Humidity object with safeguard to have min 0 and max 100 as value
      Parameters:
      value - humidity
      Returns:
      created Humidity object
    • getValue

      public int getValue()
      Returns humidity percentage value.
      Returns:
      humidity percentage.
    • setValue

      public void setValue(int value)
      Sets humidity percentage value.
      Parameters:
      value - new humidity value. Rounds to 0 or 100 if provided value isn't in allowed range.
    • getUnit

      public String getUnit()
      Returns humidity unitSystem. Constantly equals to '%'.
      Returns:
      the humidity unitSystem.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object