T - typepublic class TypeFactory<T> extends Object implements SerializationRule
| Constructor and Description |
|---|
TypeFactory(Class<T> type,
Supplier<T> factory)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
apply(SerializationClass type,
SerializationContext context,
List<SerializationRule> rules,
boolean serializing)
Apply the rule to the given type, knowing the given context.
|
boolean |
canInstantiate(TypeDefinition type,
SerializationContext context)
During deserialization, when a type needs to be instantiated, this method is called to know
if this rule is providing a custom way to instantiate the given type.
|
Supplier<T> |
getFactory() |
Class<T> |
getType() |
Object |
instantiate(TypeDefinition type,
SerializationContext context)
Called if the method canInstantiate previously returned true during deserialization.
|
boolean |
isEquivalent(SerializationRule rule)
Check if this rule is equivalent to the given rule.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconvertSerializationValue, getDeserializationType, getDeserializationValue, onInstantiationpublic boolean apply(SerializationClass type, SerializationContext context, List<SerializationRule> rules, boolean serializing)
SerializationRuleapply in interface SerializationRulepublic boolean canInstantiate(TypeDefinition type, SerializationContext context)
SerializationRulecanInstantiate in interface SerializationRulepublic Object instantiate(TypeDefinition type, SerializationContext context)
SerializationRuleinstantiate in interface SerializationRulepublic boolean isEquivalent(SerializationRule rule)
SerializationRuleisEquivalent in interface SerializationRuleCopyright © 2019. All rights reserved.