Class DataTypeTools

java.lang.Object
ch.cern.eam.wshub.core.tools.DataTypeTools

public class DataTypeTools extends Object
  • Field Details

    • NULLIFY_VALUE

      public static final Integer NULLIFY_VALUE
  • Constructor Details

    • DataTypeTools

      public DataTypeTools(Tools tools)
  • Method Details

    • convertStringToCalendar

      public static Calendar convertStringToCalendar(String date)
    • convertStringToDate

      public static Date convertStringToDate(String date)
    • encodeEAMDate

      public static org.openapplications.oagis_segments.DATETIME encodeEAMDate(Date dateValue, String dateLabel) throws EAMException
      Throws:
      EAMException
    • formatDate

      public static org.openapplications.oagis_segments.DATETIME formatDate(String dateValue, String dateLabel) throws EAMException
      Throws:
      EAMException
    • retrieveDate

      public String retrieveDate(org.openapplications.oagis_segments.DATETIME eamDateTime, String dateFormat)
    • retrieveDate

      public String retrieveDate(org.openapplications.oagis_segments.DATETIME eamDateTime)
    • decodeEAMDate

      public static Date decodeEAMDate(org.openapplications.oagis_segments.DATETIME eamDateTime)
    • encodeQuantity

      public static org.openapplications.oagis_segments.QUANTITY encodeQuantity(BigDecimal numberValue, String numberLabel) throws EAMException
      Throws:
      EAMException
    • decodeQuantity

      public static BigDecimal decodeQuantity(org.openapplications.oagis_segments.QUANTITY eamNumber)
    • encodeAmount

      public static org.openapplications.oagis_segments.AMOUNT encodeAmount(BigDecimal numberValue, String numberLabel) throws EAMException
      Throws:
      EAMException
    • decodeAmount

      public static BigDecimal decodeAmount(org.openapplications.oagis_segments.AMOUNT eamNumber)
    • encodeLong

      public long encodeLong(String longValue, String longLabel) throws EAMException
      Throws:
      EAMException
    • encodeDouble

      public double encodeDouble(String doubleValue, String longLabel) throws EAMException
      Throws:
      EAMException
    • encodeBigDecimal

      public static BigDecimal encodeBigDecimal(String stringValue, String valueLabel) throws EAMException
      Throws:
      EAMException
    • decodeBigDecimal

      public static String decodeBigDecimal(BigDecimal bigDecimalValue)
    • encodeBigInteger

      public static BigInteger encodeBigInteger(String stringValue, String valueLabel) throws EAMException
      Throws:
      EAMException
    • decodeBigInteger

      public static String decodeBigInteger(BigInteger bigIntegerValue)
    • encodeBoolean

      public static String encodeBoolean(Boolean value, BooleanType returnType)
      Encodes the boolean according to the type received
      Parameters:
      value - Boolean received
      returnType - Type of return that should be used
      Returns:
      String with the type of return received representing the boolean
    • decodeBoolean

      public static Boolean decodeBoolean(String value)
      Decode a boolean
      Parameters:
      value - Value to be converted as a boolean
      Returns:
      Will return the boolean in the string form
    • isTrueValue

      public static boolean isTrueValue(String value)
    • isFalseValue

      public static boolean isFalseValue(String value)
    • isEmpty

      public static boolean isEmpty(String value)
    • isNotEmpty

      public static boolean isNotEmpty(String value)
    • decodeBoolean

      public String decodeBoolean(Boolean value)
    • nonNullOrDefault

      public static <T> T nonNullOrDefault(T newValue, T defaultValue)
    • toCodeString

      public static String toCodeString(net.datastream.schemas.mp_fields.CLASSID_Type classIdType)
    • toCodeString

      public static String toCodeString(net.datastream.schemas.mp_fields.LOCATIONID_Type locationIdType)
    • convertBigIntegerToLong

      public static Long convertBigIntegerToLong(BigInteger value)