public interface CustomFieldHandler extends Serializable
Custom String
Metadata Type.
A single handler may be used for many Metadata fields of the same Custom data type and must be thread-safe.
Every custom field is represented externally as a String but may use a different type for internal representation as it is more efficient for comparisons.
Note that if the fields are to be used in sorting of records then the
object representations must implement Comparable
.
Modifier and Type | Method and Description |
---|---|
boolean |
areEqual(Object source,
Object target)
Compares two objects for equality assuming that they are already of the
internal value of this data type (i.e parsed).
|
Object |
getInitialDefaultValue()
Get initial default value for data type.
|
Object |
parse(Object object)
Parses any object that can be parsed into the internal representation of
this field's data type.
|
Object getInitialDefaultValue()
Object parse(Object object) throws APIException
object
- a value to parse - if null is supplied then the default
value should be returned. This value would typically be of type String
but any type should be catered for and the simplest way of doing this is
using the toString)
method of the object that
is supplied.APIException
- if the input object can not be parsed into this data
type.boolean areEqual(Object source, Object target)
source
- the source object.target
- the target object.Copyright © 2016 Push Technology Ltd. All Rights Reserved.