T
- type of object to transcodepublic class SingleValueReflectionTranscoder<T> extends Object implements ReflectionTranscoder
Modifier and Type | Field and Description |
---|---|
private ValueTranscoder<T> |
valueTranscoder
Underlying value transcoder.
|
Constructor and Description |
---|
SingleValueReflectionTranscoder(ValueTranscoder<T> transcoder)
Creates a new single value reflection transcoder.
|
Modifier and Type | Method and Description |
---|---|
Object |
decodeBinaryValues(Collection<byte[]> values)
Decodes the supplied values into an object.
|
Object |
decodeStringValues(Collection<String> values)
Decodes the supplied values into an object.
|
Collection<byte[]> |
encodeBinaryValues(Object value)
Encodes the supplied value into one or more byte arrays for use in an attribute.
|
Collection<String> |
encodeStringValues(Object value)
Encodes the supplied value into one or more strings for use in an attribute.
|
Class<?> |
getType()
Returns the type produced by this transcoder.
|
static <T> SingleValueReflectionTranscoder<T> |
newInstance(ValueTranscoder<T> transcoder)
Creates a new single value reflection transcoder.
|
boolean |
supports(Class<?> type)
Returns whether this transcoder can convert object of the supplied type.
|
String |
toString() |
private final ValueTranscoder<T> valueTranscoder
public SingleValueReflectionTranscoder(ValueTranscoder<T> transcoder)
transcoder
- for a single valuepublic static <T> SingleValueReflectionTranscoder<T> newInstance(ValueTranscoder<T> transcoder)
T
- type to transcodetranscoder
- for a single valuepublic Object decodeStringValues(Collection<String> values)
ReflectionTranscoder
decodeStringValues
in interface ReflectionTranscoder
values
- to decodepublic Object decodeBinaryValues(Collection<byte[]> values)
ReflectionTranscoder
decodeBinaryValues
in interface ReflectionTranscoder
values
- to decodepublic Collection<String> encodeStringValues(Object value)
ReflectionTranscoder
encodeStringValues
in interface ReflectionTranscoder
value
- containing data to encode as stringspublic Collection<byte[]> encodeBinaryValues(Object value)
ReflectionTranscoder
encodeBinaryValues
in interface ReflectionTranscoder
value
- containing data to encode as byte arrayspublic Class<?> getType()
ReflectionTranscoder
getType
in interface ReflectionTranscoder
public boolean supports(Class<?> type)
ReflectionTranscoder
supports
in interface ReflectionTranscoder
type
- of objectCopyright © 2003-2019 Virginia Tech. All Rights Reserved.