Package ch.cern.eam.wshub.core.tools
Class DataTypeTools
java.lang.Object
ch.cern.eam.wshub.core.tools.DataTypeTools
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Longstatic Calendarstatic DateconvertStringToDate(String date) static BigDecimaldecodeAmount(org.openapplications.oagis_segments.AMOUNT eamNumber) static StringdecodeBigDecimal(BigDecimal bigDecimalValue) static StringdecodeBigInteger(BigInteger bigIntegerValue) decodeBoolean(Boolean value) static BooleandecodeBoolean(String value) Decode a booleanstatic DatedecodeEAMDate(org.openapplications.oagis_segments.DATETIME eamDateTime) static BigDecimaldecodeQuantity(org.openapplications.oagis_segments.QUANTITY eamNumber) static org.openapplications.oagis_segments.AMOUNTencodeAmount(BigDecimal numberValue, String numberLabel) static BigDecimalencodeBigDecimal(String stringValue, String valueLabel) static BigIntegerencodeBigInteger(String stringValue, String valueLabel) static StringencodeBoolean(Boolean value, BooleanType returnType) Encodes the boolean according to the type receiveddoubleencodeDouble(String doubleValue, String longLabel) static org.openapplications.oagis_segments.DATETIMEencodeEAMDate(Date dateValue, String dateLabel) longencodeLong(String longValue, String longLabel) static org.openapplications.oagis_segments.QUANTITYencodeQuantity(BigDecimal numberValue, String numberLabel) static org.openapplications.oagis_segments.DATETIMEformatDate(String dateValue, String dateLabel) static booleanstatic booleanisFalseValue(String value) static booleanisNotEmpty(String value) static booleanisTrueValue(String value) static <T> TnonNullOrDefault(T newValue, T defaultValue) retrieveDate(org.openapplications.oagis_segments.DATETIME eamDateTime) retrieveDate(org.openapplications.oagis_segments.DATETIME eamDateTime, String dateFormat) static StringtoCodeString(net.datastream.schemas.mp_fields.CLASSID_Type classIdType) static StringtoCodeString(net.datastream.schemas.mp_fields.LOCATIONID_Type locationIdType)
-
Field Details
-
NULLIFY_VALUE
-
-
Constructor Details
-
DataTypeTools
-
-
Method Details
-
convertStringToCalendar
-
convertStringToDate
-
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
-
retrieveDate
-
decodeEAMDate
-
encodeQuantity
public static org.openapplications.oagis_segments.QUANTITY encodeQuantity(BigDecimal numberValue, String numberLabel) throws EAMException - Throws:
EAMException
-
decodeQuantity
-
encodeAmount
public static org.openapplications.oagis_segments.AMOUNT encodeAmount(BigDecimal numberValue, String numberLabel) throws EAMException - Throws:
EAMException
-
decodeAmount
-
encodeLong
- Throws:
EAMException
-
encodeDouble
- Throws:
EAMException
-
encodeBigDecimal
public static BigDecimal encodeBigDecimal(String stringValue, String valueLabel) throws EAMException - Throws:
EAMException
-
decodeBigDecimal
-
encodeBigInteger
public static BigInteger encodeBigInteger(String stringValue, String valueLabel) throws EAMException - Throws:
EAMException
-
decodeBigInteger
-
encodeBoolean
Encodes the boolean according to the type received- Parameters:
value- Boolean receivedreturnType- Type of return that should be used- Returns:
- String with the type of return received representing the boolean
-
decodeBoolean
Decode a boolean- Parameters:
value- Value to be converted as a boolean- Returns:
- Will return the boolean in the string form
-
isTrueValue
-
isFalseValue
-
isEmpty
-
isNotEmpty
-
decodeBoolean
-
nonNullOrDefault
public static <T> T nonNullOrDefault(T newValue, T defaultValue) -
toCodeString
-
toCodeString
-
convertBigIntegerToLong
-