Class SimpleTypeLiaison<U>
java.lang.Object
space.arim.dazzleconf.engine.liaison.SimpleTypeLiaison<U>
- Type Parameters:
U- the type being provided
- All Implemented Interfaces:
TypeLiaison
A simple type liaison that wraps a
SerializeDeserialize.
This class is probably appropriate for most user types. It provides serialization for a single user type, and relies on the configuration interface method to supply a default value by being a default method.
-
Nested Class Summary
Nested classes/interfaces inherited from interface space.arim.dazzleconf.engine.TypeLiaison
TypeLiaison.Agent<V>, TypeLiaison.DefaultInit<V>, TypeLiaison.Handshake -
Constructor Summary
ConstructorsConstructorDescriptionSimpleTypeLiaison(@NonNull TypeToken<U> typeToken, @NonNull SerializeDeserialize<U> serializeDeserialize) Creates from a type token and the provided serialization -
Method Summary
Modifier and TypeMethodDescription<V> @Nullable TypeLiaison.Agent<V> makeAgent(@NonNull TypeToken<V> typeToken, @NonNull TypeLiaison.Handshake handshake) Attempts to support the following type.
-
Constructor Details
-
SimpleTypeLiaison
public SimpleTypeLiaison(@NonNull TypeToken<U> typeToken, @NonNull SerializeDeserialize<U> serializeDeserialize) Creates from a type token and the provided serialization- Parameters:
typeToken- the type tokenserializeDeserialize- the serialization
-
-
Method Details
-
makeAgent
@SideEffectFree public <V> @Nullable TypeLiaison.Agent<V> makeAgent(@NonNull TypeToken<V> typeToken, @NonNull TypeLiaison.Handshake handshake) Description copied from interface:TypeLiaisonAttempts to support the following type.If supported, an agent is returned that handles type serialization, deserialization, and defaults. Note that implementations may need casting at the source level to satisfy the generic argument of the token requested.
- Specified by:
makeAgentin interfaceTypeLiaison- Type Parameters:
V- the type being requested- Parameters:
typeToken- the type tokenhandshake- the handshake- Returns:
- the agent if supported, or null otherwise
-