java.lang.Object
oracle.communication.brm.charging.util.directevolution.DAbstractEvolvable
oracle.communication.brm.charging.util.unit.Money
All Implemented Interfaces:
Serializable, Cloneable, oracle.communication.brm.charging.util.directevolution.DEvolvable, Unit<Money>

public class Money extends oracle.communication.brm.charging.util.directevolution.DAbstractEvolvable implements Unit<Money>
Class presents a Unit that represents a Currency. Each Unit has a Currency and its associated symbol.
Version:
1.0
Author:
ashsriva
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    final class 
     

    Nested classes/interfaces inherited from interface oracle.communication.brm.charging.util.unit.Unit

    Unit.UnitMisMatchException
  • Field Summary

    Fields inherited from interface oracle.communication.brm.charging.util.unit.Unit

    MATH_CONTEXT
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor required for evolution
    Constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    convert(UnitValue<Money> otherValue)
    Returns an instance of the UnitValue with this Unit converted according to a specific ratio
    oracle.communication.brm.charging.util.directevolution.DEvolvable
     
    boolean
     
    Returns the Currency
    long
    Deprecated.
    void
    giveInitializerTo(oracle.communication.brm.charging.util.directevolution.DEvolvableHelper evolvableHelper)
     
    int
     
    money(long count, String symbol)
    Creates an instance of Money of type Currency with the passed symbol.
     
    Returns an instance of the UnitValue with this Unit and provided quantity

    Methods inherited from class oracle.communication.brm.charging.util.directevolution.DAbstractEvolvable

    clone, getEvolutionData, setEvolutionData

    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Money

      public Money()
      Default constructor required for evolution
    • Money

      public Money(Currency cur)
      Constructor
      Parameters:
      cur - Currency
  • Method Details

    • createInstance

      public oracle.communication.brm.charging.util.directevolution.DEvolvable createInstance()
      Specified by:
      createInstance in interface oracle.communication.brm.charging.util.directevolution.DEvolvable
    • giveInitializerTo

      public void giveInitializerTo(oracle.communication.brm.charging.util.directevolution.DEvolvableHelper evolvableHelper)
      Specified by:
      giveInitializerTo in interface oracle.communication.brm.charging.util.directevolution.DEvolvable
    • getCurrency

      public Currency getCurrency()
      Returns the Currency
      Returns:
      Currency
    • getRatio

      @Deprecated public long getRatio(Money d)
      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<Money>
      Parameters:
      d - Money
      Returns:
      long either 1 if two Money are represented in the same currency code The Money class does not support 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<Money> valueOf(BigDecimal b)
      Returns an instance of the UnitValue with this Unit and provided quantity
      Specified by:
      valueOf in interface Unit<Money>
      Parameters:
      b - BigDecimal
      Returns:
      UnitValue
    • convert

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

      public static UnitValue<Money> money(long count, String symbol)
      Creates an instance of Money of type Currency with the passed symbol.
      Parameters:
      count - The amount of Money
      symbol - The Currency currency code like USD.
      Returns:
      UnitValue of type Money
    • 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 oracle.communication.brm.charging.util.directevolution.DAbstractEvolvable