protected class ValueTypeSystem.Factory<T> extends Object implements TypeSystem.TypeFactory<T>
Modifier and Type | Field and Description |
---|---|
protected PropertyType |
type |
protected String |
typeName |
protected ValueFactory<T> |
valueFactory |
Modifier | Constructor and Description |
---|---|
protected |
Factory(ValueFactory<T> valueFactory) |
Modifier and Type | Method and Description |
---|---|
String |
asReadableString(Object value)
Get a readable and potentially shorter string representation of the supplied value.
|
String |
asString(Object value)
Get the string representation of the supplied value.
|
T |
create(Object value)
Create the typed representation of the value given the supplied object representation.
|
T |
create(String value)
Create the typed representation of the value given the supplied string representation.
|
Comparator<T> |
getComparator()
Get a comparator that can be used to store the values of this type.
|
Class<T> |
getType()
Get the class representing the value type.
|
String |
getTypeName()
Get the name of the type created by this factory.
|
long |
length(Object value)
Get the length of the supplied value.
|
String |
toString() |
protected final PropertyType type
protected final ValueFactory<T> valueFactory
protected final String typeName
protected Factory(ValueFactory<T> valueFactory)
public String asReadableString(Object value)
TypeSystem.TypeFactory
asReadableString
in interface TypeSystem.TypeFactory<T>
value
- the valuepublic String asString(Object value)
TypeSystem.TypeFactory
asString
in interface TypeSystem.TypeFactory<T>
value
- the valuepublic T create(String value) throws ValueFormatException
TypeSystem.TypeFactory
create
in interface TypeSystem.TypeFactory<T>
value
- the string representation of the valuetype
ValueFormatException
- if the string cannot be converted to a typed valuepublic T create(Object value) throws ValueFormatException
TypeSystem.TypeFactory
create
in interface TypeSystem.TypeFactory<T>
value
- the object representation of the valuetype
ValueFormatException
- if the object cannot be converted to a typed valuepublic Class<T> getType()
TypeSystem.TypeFactory
getType
in interface TypeSystem.TypeFactory<T>
public long length(Object value)
TypeSystem.TypeFactory
length
in interface TypeSystem.TypeFactory<T>
value
- the valuepublic Comparator<T> getComparator()
TypeSystem.TypeFactory
getComparator
in interface TypeSystem.TypeFactory<T>
public String getTypeName()
TypeSystem.TypeFactory
getTypeName
in interface TypeSystem.TypeFactory<T>
Copyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.