Class ObjectConverterDefault
- All Implemented Interfaces:
- ObjectConverter
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionintCompare two elements.byte[]convertBase64StringToByteArray(Object object) Converts the element to aBigDecimal.convertByteArrayToBase64String(byte[] byteArray) Converts the element to aBase64 String.<T> TTries to convert the element to the specifiedtargetType.convertToBigDecimal(Object object) Converts the element to aBigDecimal.convertToBoolean(Object object) Converts the element to aJsonArray.Converts the element to aDate.convertToDouble(Object object) Converts the element to aDouble.convertToFloat(Object object) Converts the element to aFloat.Converts the element to aInstant.convertToInteger(Object object) Converts the element to aInteger.convertToJsonArray(Object object) Converts the element to aJsonArray.convertToJsonDateFormat(Date date) Converts the date to a String representaiton compatible with the Json specification.convertToJsonObject(Object object) Converts the element to aJsonObject.convertToLong(Object object) Converts the element to aLong.convertToString(Object object) Converts the element to aJsonObject.protected JsonManagerbooleanisAtLeastOneEquivalentElementInCommon(Collection<?> col1, Collection<?> col2) Do the two Collections have at least one equivalent element in common?booleanisBase64StringOrNull(Object object) Returnstrueif the element is a valid base 64 String, or isnull.booleanisCanBeConvertedTo(Class<?> referenceType, Object elementToValidate) Can the element be converted to the specifiedreferenceType?booleanisCanBeConvertedToBigDecimal(Object object) Can the element be converted to aBigDecimal?booleanisCanBeConvertedToBoolean(Object object) Can the element be converted to aBoolean?booleanisCanBeConvertedToByteArray(Object object) Can the element be converted to abyte[]?booleanCan the element be converted to aDate? The source element must follow the Json date format.booleanisCanBeConvertedToDouble(Object object) Can the element be converted to aDouble?booleanisCanBeConvertedToFloat(Object object) Can the element be converted to aFloat?booleanisCanBeConvertedToInteger(Object object) Can the element be converted to aInteger?booleanisCanBeConvertedToJsonArray(Object object) Can the element be converted to aJsonArray?booleanisCanBeConvertedToJsonObject(Object object) Can the element be converted to aJsonObject?booleanisCanBeConvertedToLong(Object object) Can the element be converted to aLong?booleanisCanBeConvertedToString(Object object) Can the element be converted to aString?booleanisEquivalent(Object valueToCompare, Object compareTo) Are the two elements equivalent?
- 
Constructor Details- 
ObjectConverterDefault
 
- 
- 
Method Details- 
getJsonManager
- 
isCanBeConvertedToDescription copied from interface:ObjectConverterCan the element be converted to the specifiedreferenceType?- Specified by:
- isCanBeConvertedToin interface- ObjectConverter
 
- 
isCanBeConvertedToStringDescription copied from interface:ObjectConverterCan the element be converted to aString?- Specified by:
- isCanBeConvertedToStringin interface- ObjectConverter
 
- 
isCanBeConvertedToIntegerDescription copied from interface:ObjectConverterCan the element be converted to aInteger?- Specified by:
- isCanBeConvertedToIntegerin interface- ObjectConverter
 
- 
isCanBeConvertedToLongDescription copied from interface:ObjectConverterCan the element be converted to aLong?- Specified by:
- isCanBeConvertedToLongin interface- ObjectConverter
 
- 
isCanBeConvertedToFloatDescription copied from interface:ObjectConverterCan the element be converted to aFloat?- Specified by:
- isCanBeConvertedToFloatin interface- ObjectConverter
 
- 
isCanBeConvertedToDoubleDescription copied from interface:ObjectConverterCan the element be converted to aDouble?- Specified by:
- isCanBeConvertedToDoublein interface- ObjectConverter
 
- 
isCanBeConvertedToBooleanDescription copied from interface:ObjectConverterCan the element be converted to aBoolean?- Specified by:
- isCanBeConvertedToBooleanin interface- ObjectConverter
 
- 
isCanBeConvertedToBigDecimalDescription copied from interface:ObjectConverterCan the element be converted to aBigDecimal?- Specified by:
- isCanBeConvertedToBigDecimalin interface- ObjectConverter
 
- 
isCanBeConvertedToByteArrayDescription copied from interface:ObjectConverterCan the element be converted to abyte[]?- Specified by:
- isCanBeConvertedToByteArrayin interface- ObjectConverter
 
- 
isCanBeConvertedToDateFromJsonDateFormatDescription copied from interface:ObjectConverterCan the element be converted to aDate? The source element must follow the Json date format.- Specified by:
- isCanBeConvertedToDateFromJsonDateFormatin interface- ObjectConverter
 
- 
isCanBeConvertedToJsonObjectDescription copied from interface:ObjectConverterCan the element be converted to aJsonObject?- Specified by:
- isCanBeConvertedToJsonObjectin interface- ObjectConverter
 
- 
isCanBeConvertedToJsonArrayDescription copied from interface:ObjectConverterCan the element be converted to aJsonArray?- Specified by:
- isCanBeConvertedToJsonArrayin interface- ObjectConverter
 
- 
isBase64StringOrNullDescription copied from interface:ObjectConverterReturnstrueif the element is a valid base 64 String, or isnull.- Specified by:
- isBase64StringOrNullin interface- ObjectConverter
 
- 
convertToJsonObjectDescription copied from interface:ObjectConverterConverts the element to aJsonObject.- Specified by:
- convertToJsonObjectin interface- ObjectConverter
 
- 
convertToJsonArrayDescription copied from interface:ObjectConverterConverts the element to aJsonArray.- Specified by:
- convertToJsonArrayin interface- ObjectConverter
 
- 
convertToStringDescription copied from interface:ObjectConverterConverts the element to aJsonObject.- Specified by:
- convertToStringin interface- ObjectConverter
 
- 
convertToIntegerDescription copied from interface:ObjectConverterConverts the element to aInteger.The toString()method will be called on the object before trying to convert it to an Integer. If the resulting String contains zeros only decimals, those will be removed and the conversion will work.For example : "123.0" will work. - Specified by:
- convertToIntegerin interface- ObjectConverter
- Throws:
- CantConvertException- if the element can't be converted to the required type.
 
- 
convertToLongDescription copied from interface:ObjectConverterConverts the element to aLong.The toString()method will be called on the object before trying to convert it to a Long. If the resulting String contains zeros only decimals, those will be removed and the conversion will work.For example : "123.0" will work. - Specified by:
- convertToLongin interface- ObjectConverter
- Throws:
- CantConvertException- if the element can't be converted to the required type.
 
- 
convertToFloatDescription copied from interface:ObjectConverterConverts the element to aFloat.- Specified by:
- convertToFloatin interface- ObjectConverter
- Throws:
- CantConvertException- if the element can't be converted to the required type.
 
- 
convertToDoubleDescription copied from interface:ObjectConverterConverts the element to aDouble.- Specified by:
- convertToDoublein interface- ObjectConverter
- Throws:
- CantConvertException- if the element can't be converted to the required type.
 
- 
convertToBooleanDescription copied from interface:ObjectConverterConverts the element to aJsonArray.Il can be converted to a Booleanif its already a Boolean, if it'snullor if it's the String "true" or the String "false".- Specified by:
- convertToBooleanin interface- ObjectConverter
- Throws:
- CantConvertException- if the element can't be converted to the required type.
 
- 
convertToBigDecimalDescription copied from interface:ObjectConverterConverts the element to aBigDecimal.- Specified by:
- convertToBigDecimalin interface- ObjectConverter
- Throws:
- CantConvertException- if the element can't be converted to the required type.
 
- 
convertBase64StringToByteArrayDescription copied from interface:ObjectConverterConverts the element to aBigDecimal.Can be converted to a byte[]if its already abyte[], if it'snullor if it's a valid base 64String.- Specified by:
- convertBase64StringToByteArrayin interface- ObjectConverter
- Throws:
- CantConvertException- if the element can't be converted to the required type.
 
- 
convertByteArrayToBase64StringDescription copied from interface:ObjectConverterConverts the element to aBase64 String.- Specified by:
- convertByteArrayToBase64Stringin interface- ObjectConverter
 
- 
convertToDateFromJsonDateFormatDescription copied from interface:ObjectConverterConverts the element to aDate.The source element must follow the Json date format (ISO 8601). - Specified by:
- convertToDateFromJsonDateFormatin interface- ObjectConverter
- Throws:
- CantConvertException- if the element can't be converted to the required type.
 
- 
convertToInstantFromJsonDateFormatDescription copied from interface:ObjectConverterConverts the element to aInstant.The source element must follow the Json date format (ISO 8601). - Specified by:
- convertToInstantFromJsonDateFormatin interface- ObjectConverter
- Throws:
- CantConvertException- if the element can't be converted to the required type.
 
- 
convertToDescription copied from interface:ObjectConverterTries to convert the element to the specifiedtargetType.By default, only the types native to JsonObject are supported as the target types. - Specified by:
- convertToin interface- ObjectConverter
- Throws:
- CantConvertException- if the element can't be converted to the required type.
 
- 
convertToJsonDateFormatDescription copied from interface:ObjectConverterConverts the date to a String representaiton compatible with the Json specification.- Specified by:
- convertToJsonDateFormatin interface- ObjectConverter
 
- 
compareToDescription copied from interface:ObjectConverterCompare two elements.If required, try to convert the elementToCompareso it can be compared withcompareTo. It is also possible that we have to convertcompareTo, for the comparison to be possible. For example, ifcompareTois Long(10) andelementToCompareis BigDecimal(12.34), we have to convert both elements to BigDecimal so they can be compared.For a comparison to work, the two elements must be (after conversion or not) of the same type and this type must implement Comparable.- Specified by:
- compareToin interface- ObjectConverter
- Throws:
- CantCompareException- if the elements can't be compared together.
 
- 
isEquivalentDescription copied from interface:ObjectConverterAre the two elements equivalent?If required, try to convert the elementToCompareso it can be compared withcompareTo. It is also possible that we have to convertcompareTo, for the comparison to be possible. For example, ifcompareTois Long(10) andelementToCompareis BigDecimal(12.34), we have to convert both elements to BigDecimal so they can be compared.For the two elements to be equivalent, they must be (after conversion or not) of the same type and then the Object.equals(Object)method must returntrue.- Specified by:
- isEquivalentin interface- ObjectConverter
 
- 
isAtLeastOneEquivalentElementInCommonDescription copied from interface:ObjectConverterDo the two Collections have at least one equivalent element in common?- Specified by:
- isAtLeastOneEquivalentElementInCommonin interface- ObjectConverter
 
 
-