Enum Class PressureUnit

java.lang.Object
java.lang.Enum<PressureUnit>
com.irurueta.units.PressureUnit
All Implemented Interfaces:
Serializable, Comparable<PressureUnit>, Constable

public enum PressureUnit extends Enum<PressureUnit>
Enumerator containing recognized typical pressure units.
  • Enum Constant Details

    • PASCAL

      public static final PressureUnit PASCAL
      Pascal (Pa).
    • KILOPASCAL

      public static final PressureUnit KILOPASCAL
      Kilopascal (kPa).
    • BAR

      public static final PressureUnit BAR
      Bar (bar).
    • ATMOSPHERE

      public static final PressureUnit ATMOSPHERE
      Standard atmosphere (atm).
    • PSI

      public static final PressureUnit PSI
      Pounds per square inch (psi).
  • Constructor Details

    • PressureUnit

      private PressureUnit()
  • Method Details

    • values

      public static PressureUnit[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static PressureUnit valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getUnitSystem

      public static UnitSystem getUnitSystem(PressureUnit unit)
      Returns unit system for provided pressure unit.
      Parameters:
      unit - pressure unit to be checked.
      Returns:
      unit system (metric or imperial).
      Throws:
      IllegalArgumentException - if unit is null or not supported.
    • getMetricUnits

      public static PressureUnit[] getMetricUnits()
      Gets all supported metric pressure units.
      Returns:
      all supported metric pressure units.
    • getImperialUnits

      public static PressureUnit[] getImperialUnits()
      Gets all supported imperial pressure units.
      Returns:
      all supported imperial pressure units.
    • isMetric

      public static boolean isMetric(PressureUnit unit)
      Indicates whether provided unit belongs to the metric unit system.
      Parameters:
      unit - pressure unit to be checked.
      Returns:
      true if unit belongs to metric unit system.
      Throws:
      IllegalArgumentException - if unit is null or not supported.
    • isImperial

      public static boolean isImperial(PressureUnit unit)
      Indicates whether provided unit belongs to the imperial unit system.
      Parameters:
      unit - pressure unit to be checked.
      Returns:
      true if unit belongs to imperial unit system.
      Throws:
      IllegalArgumentException - if unit is null or not supported.