Enum Class Occurrence

java.lang.Object
java.lang.Enum<Occurrence>
oracle.communication.brm.charging.util.unit.Occurrence
All Implemented Interfaces:
Serializable, Comparable<Occurrence>, Constable, Unit<Occurrence>

public enum Occurrence extends Enum<Occurrence> implements Unit<Occurrence>
Represents the frequency unit. Supported Unit is "Occ".
Version:
1.0
Author:
ashsriva
  • Enum Constant Details

  • Field Details

    • ALLOWABLE_OCCURENCE

      public static final transient EnumSet<Occurrence> ALLOWABLE_OCCURENCE
  • Method Details

    • values

      public static Occurrence[] 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 Occurrence 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
    • getRatio

      @Deprecated public long getRatio(Occurrence o)
      Deprecated.
      Description copied from interface: Unit
      NOTE: for backward compatibility, actually obsolete Deprecated, use convert instead The method returns the ratio of numeric conversion between the this and the passed unit. The method throws Unit.UnitMisMatchException if ratio between the two units is not supported.
      Specified by:
      getRatio in interface Unit<Occurrence>
      Parameters:
      o - Occurrence Unit
      Returns:
      long Always returns 1 as occurrence types are not supported. TODO: this method should be made private, it is still public here to provide backward compatibility to customers who are potentially still using it.
    • valueOf

      public UnitValue<Occurrence> valueOf(BigDecimal b)
      Returns an instance of the UnitValue with this Unit and provided quantity
      Specified by:
      valueOf in interface Unit<Occurrence>
      Parameters:
      b - BigDecimal
      Returns:
      UnitValue
    • convert

      public UnitValue<Occurrence> convert(UnitValue<Occurrence> otherValue)
      Returns an instance of the UnitValue with this Unit converted according to a specific ratio
      Specified by:
      convert in interface Unit<Occurrence>
      Parameters:
      otherValue - UnitValue unit value to convert to
      Returns:
      UnitValue unit value resulting from conversion of otherValue to the unit
    • createValueFromUnitString

      public static UnitValue<Occurrence> createValueFromUnitString(String unitString, BigDecimal theValue)
      helper method used to choose the correct UOM and set the value.
      Parameters:
      unitString - the UOM for the Data value
      theValue - the data value
      Returns:
      returns the newly created UnitValue from the supplied values.