public class ByteBufferConverter extends Object implements ConditionalGenericConverter
ByteBuffer directly to and from byte[]s and indirectly to
any type that the ConversionService support via byte[].GenericConverter.ConvertiblePair| Constructor and Description |
|---|
ByteBufferConverter(ConversionService conversionService) |
| Modifier and Type | Method and Description |
|---|---|
Object |
convert(Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType)
Convert the source to the targetType described by the TypeDescriptor.
|
Set<GenericConverter.ConvertiblePair> |
getConvertibleTypes()
Return the source and target types which this converter can convert between.
|
boolean |
matches(TypeDescriptor sourceType,
TypeDescriptor targetType)
Should the conversion from
sourceType to targetType currently under
consideration be selected? |
public ByteBufferConverter(ConversionService conversionService)
public Set<GenericConverter.ConvertiblePair> getConvertibleTypes()
GenericConverter
For conditional converters this method may return
null to indicate all source-to-target pairs should be considered. *
getConvertibleTypes in interface GenericConverterpublic boolean matches(TypeDescriptor sourceType, TypeDescriptor targetType)
ConditionalConvertersourceType to targetType currently under
consideration be selected?matches in interface ConditionalConvertersourceType - the type descriptor of the field we are converting fromtargetType - the type descriptor of the field we are converting topublic Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType)
GenericConverterconvert in interface GenericConvertersource - the source object to convert (may be null)sourceType - the type descriptor of the field we are converting fromtargetType - the type descriptor of the field we are converting to