Package org.symphonyoss.s2.canon.runtime
Class TypeDefBuilder<M,T>
- java.lang.Object
-
- org.symphonyoss.s2.canon.runtime.TypeDefBuilder<M,T>
-
- Type Parameters:
M- The model (TypeDef) type.T- The value type.
- Direct Known Subclasses:
BooleanTypeDefBuilder,ByteStringTypeDefBuilder,DoubleTypeDefBuilder,FloatTypeDefBuilder,ImmutableByteArrayTypeDefBuilder,IntegerTypeDefBuilder,LongTypeDefBuilder,StringTypeDefBuilder
public abstract class TypeDefBuilder<M,T> extends Object
Base class for TypeDef builders.- Author:
- Bruce Skingle
-
-
Constructor Summary
Constructors Constructor Description TypeDefBuilder()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract Mbuild(org.symphonyoss.s2.common.dom.json.JsonValue<?,?> jsonValue)Build an instance of the typedef class from the value provided by the given JsonValue.abstract Mbuild(T value)Build an instance of the typedef class from the given value.abstract TtoValue(M instance)Return the value of the given typedef.
-
-
-
Method Detail
-
build
public abstract M build(T value)
Build an instance of the typedef class from the given value.- Parameters:
value- A value to be wrapped in a typedef.- Returns:
- an instance of the typedef class from the given value.
- Throws:
IllegalArgumentException- if the value is null or otherwise invalid. This may be the case if the schema defines limits on the magnitude of the value, or if a facade has been written for the type.
-
build
public abstract M build(org.symphonyoss.s2.common.dom.json.JsonValue<?,?> jsonValue)
Build an instance of the typedef class from the value provided by the given JsonValue.- Parameters:
jsonValue- A JsonValue whose value is to be wrapped in a typedef.- Returns:
- an instance of the typedef class from the value provided by the given JsonValue.
- Throws:
IllegalArgumentException- if the value is of the incorrect type of is null or otherwise invalid. This may be the case if the schema defines limits on the magnitude of the value, or if a facade has been written for the type.
-
-