@Immutable public abstract class TypeSystem extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
TypeSystem.SerializableComparator<T> |
static interface |
TypeSystem.TypeFactory<T>
Factory interface for creating values from strings.
|
Constructor and Description |
---|
TypeSystem() |
Modifier and Type | Method and Description |
---|---|
abstract String |
asString(Object value)
Get the string representation of the supplied value, using the most appropriate factory given the value.
|
abstract TypeSystem.TypeFactory<BinaryValue> |
getBinaryFactory()
Get the type factory for binary objects.
|
abstract TypeSystem.TypeFactory<Boolean> |
getBooleanFactory()
Get the type factory for boolean types.
|
abstract String |
getCompatibleType(String type1,
String type2)
Get the type that is compatible with both of the supplied types.
|
abstract TypeSystem.TypeFactory<?> |
getCompatibleType(TypeSystem.TypeFactory<?> type1,
TypeSystem.TypeFactory<?> type2)
Get the type that is compatible with both of the supplied types.
|
abstract TypeSystem.TypeFactory<?> |
getDateTimeFactory()
Get the type factory for date-time objects.
|
abstract TypeSystem.TypeFactory<BigDecimal> |
getDecimalFactory()
Get the type factory for decimal types.
|
abstract Comparator<Object> |
getDefaultComparator()
Get the comparator that should be used by default.
|
abstract String |
getDefaultType()
Get the name of the type that is used by default.
|
abstract TypeSystem.TypeFactory<Double> |
getDoubleFactory()
Get the type factory for double types.
|
abstract TypeSystem.TypeFactory<Long> |
getLongFactory()
Get the type factory for long types.
|
abstract TypeSystem.TypeFactory<Name> |
getNameFactory()
Get the type factory for name objects.
|
abstract TypeSystem.TypeFactory<NodeKey> |
getNodeKeyFactory()
Get the type factory for node key objects.
|
abstract TypeSystem.TypeFactory<Path> |
getPathFactory()
Get the type factory for path objects.
|
abstract TypeSystem.TypeFactory<Reference> |
getReferenceFactory()
Get the type factory for references objects.
|
abstract TypeSystem.TypeFactory<String> |
getStringFactory()
Get the type factory for string types.
|
abstract TypeSystem.TypeFactory<?> |
getTypeFactory(Object prototype)
Get the type factory for the type denoted by the supplied prototype value.
|
abstract TypeSystem.TypeFactory<?> |
getTypeFactory(String typeName)
Get the type factory given the name of the type.
|
abstract Set<String> |
getTypeNames()
Get the names of the supported types.
|
static <T> TypeSystem.TypeFactory<T> |
with(TypeSystem.TypeFactory<T> original,
Order order,
NullOrder nullOrder)
|
static <T> TypeSystem.TypeFactory<T> |
withComparator(TypeSystem.TypeFactory<T> original,
Comparator<T> comparator)
Return a new type factory that has a comparator that inverts the normal comparison.
|
static <T> TypeSystem.TypeFactory<T> |
withOppositeComparator(TypeSystem.TypeFactory<T> original)
Return a new type factory that has a comparator that inverts the normal comparison.
|
public abstract TypeSystem.TypeFactory<?> getTypeFactory(String typeName)
typeName
- the name of the typepublic abstract TypeSystem.TypeFactory<?> getTypeFactory(Object prototype)
prototype
- the value whose type is to be identifiedpublic abstract TypeSystem.TypeFactory<Boolean> getBooleanFactory()
public abstract TypeSystem.TypeFactory<Long> getLongFactory()
public abstract TypeSystem.TypeFactory<String> getStringFactory()
public abstract TypeSystem.TypeFactory<Double> getDoubleFactory()
public abstract TypeSystem.TypeFactory<BigDecimal> getDecimalFactory()
public abstract TypeSystem.TypeFactory<?> getDateTimeFactory()
public abstract TypeSystem.TypeFactory<Path> getPathFactory()
public abstract TypeSystem.TypeFactory<Name> getNameFactory()
public abstract TypeSystem.TypeFactory<Reference> getReferenceFactory()
public abstract TypeSystem.TypeFactory<NodeKey> getNodeKeyFactory()
public abstract TypeSystem.TypeFactory<BinaryValue> getBinaryFactory()
public abstract String getDefaultType()
public abstract Comparator<Object> getDefaultComparator()
public abstract Set<String> getTypeNames()
public abstract String asString(Object value)
value
- the valuepublic abstract String getCompatibleType(String type1, String type2)
type1
- the first type; may be nulltype2
- the second type; may be nullpublic abstract TypeSystem.TypeFactory<?> getCompatibleType(TypeSystem.TypeFactory<?> type1, TypeSystem.TypeFactory<?> type2)
type1
- the first type; may be nulltype2
- the second type; may be nullpublic static <T> TypeSystem.TypeFactory<T> withComparator(TypeSystem.TypeFactory<T> original, Comparator<T> comparator)
original
- the original type factory; may not be nullcomparator
- the new comparator to use; may be nulloriginal
if comparator
is nullpublic static <T> TypeSystem.TypeFactory<T> withOppositeComparator(TypeSystem.TypeFactory<T> original)
original
- the original type factory; may not be nullpublic static <T> TypeSystem.TypeFactory<T> with(TypeSystem.TypeFactory<T> original, Order order, NullOrder nullOrder)
Order
and NullOrder
behavior.original
- the original type factory; may not be nullorder
- the specification of whether the comparator should order ascending or descending; may not be nullnullOrder
- the specification of whether null values should appear first or last; may not be nulloriginal
if it has the desired behaviorCopyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.