OBJ
- type of object containing the datapublic interface ValueConverter<OBJ>
Modifier and Type | Method and Description |
---|---|
default int |
getPriority()
Determines the relative priority of this converter compared to other converters
of the same type.
|
<T> T |
getValue(OBJ obj,
String itemName,
Class<T> valueType,
T defaultValue)
Implement this method to return the converted value type.
Will only be invoked if supportsRead(Class) returns
true. |
<T> List<T> |
getValueAsList(OBJ obj,
String itemName,
Class<T> valueType,
List<T> defaultValue)
Implement this method to return a list of the converted value type.
Will only be invoked if supportsRead(Class) returns
true. |
<T> void |
setValue(OBJ obj,
String itemName,
T newValue)
Implement this method to write a value to the object
|
boolean |
supportsRead(Class<?> valueType)
Return
true here for all value types that
the implementation class supports to read object
data. |
boolean |
supportsWrite(Class<?> valueType,
Object value)
Return
true here for all value types that
the implementation class supports to write object
data. |
boolean supportsRead(Class<?> valueType)
true
here for all value types that
the implementation class supports to read object
data.valueType
- requested return value typeboolean supportsWrite(Class<?> valueType, Object value)
true
here for all value types that
the implementation class supports to write object
data.valueType
- requested return value typevalue
- the requested value to write (may be null)<T> T getValue(OBJ obj, String itemName, Class<T> valueType, T defaultValue)
supportsRead(Class)
returns
true.T
- value typeobj
- objectitemName
- item to readvalueType
- requested return value typedefaultValue
- default value to return if object property is not set<T> List<T> getValueAsList(OBJ obj, String itemName, Class<T> valueType, List<T> defaultValue)
supportsRead(Class)
returns
true.T
- value typeobj
- objectitemName
- item to readvalueType
- requested return value typedefaultValue
- default value to return if object property is not set<T> void setValue(OBJ obj, String itemName, T newValue)
T
- value typeobj
- objectitemName
- name of item to writenewValue
- new valuedefault int getPriority()
The default value is 0
and higher values take precedence.
Copyright © 2019–2021 HCL. All rights reserved.