Class RomanInteger

java.lang.Object
com.aquima.interactions.framework.mask.impl.AbstractMask
com.aquima.interactions.framework.mask.impl.RomanInteger
All Implemented Interfaces:
IMask

public class RomanInteger extends AbstractMask implements IMask

Mask to convert an IntegerValue to roman notation.

Example: IntegerValue(512) -> DXII

Note: values smaller than 1 cannot be converted to a roman notation, trying to convert these values will throw an IllegalArgumentException.

Optional parameters:
  • case: lower/upper Roman spelled integer will be lower or upper case (default=upper).
Since:
6.0
Author:
Jon van Leuven
  • Constructor Details

    • RomanInteger

      public RomanInteger(ISpellEngine spellEngine)
      Construct a roman integer mask.
      Parameters:
      spellEngine - Spell engine used for spelling dates.
  • Method Details

    • applySingleValue

      protected String applySingleValue(ISingleValue singleValue, IMaskContext context, ILanguage language) throws Exception
      Description copied from class: AbstractMask
      This method is called when this mask is applied.
      Specified by:
      applySingleValue in class AbstractMask
      Parameters:
      singleValue - The value, never null and never unknown.
      context - Mask context
      language - the language
      Returns:
      The applied mask result.
      Throws:
      Exception - When something went wrong.
    • getValidDataTypes

      protected DataType[] getValidDataTypes()
      Description copied from class: AbstractMask
      Should return the datatypes for which this mask can be applied.
      Specified by:
      getValidDataTypes in class AbstractMask
      Returns:
      Array of datatypes.