Package space.arim.dazzleconf.engine
Interface TypeLiaison
- All Known Implementing Classes:
BooleanLiaison,ByteLiaison,CharacterLiaison,CollectionLiaison,DoubleLiaison,EnumLiaison,FloatLiaison,IntegerLiaison,LongLiaison,MapLiaison,ShortLiaison,SimpleTypeLiaison,StringLiaison,SubSectionLiaison
public interface TypeLiaison
Powerful handle for working with types, serializing them, and representing them throughout the library structure
and configuration construction process.
Type liaisons are first contacted when the configuration is constructed, and paired with configuration entries. This act of pairing includes making the agent, associating the type with its serializer, and quering default values whenever the type is used as a return value.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceAn agent that is ready to handle matters relating to a typestatic interfaceProvides relevant resources related to default value creationstatic interfaceCallback interface allowingTypeLiaison.Agentto access certain resources -
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.
-
Method Details
-
makeAgent
@SideEffectFree <V> @Nullable TypeLiaison.Agent<V> makeAgent(@NonNull TypeToken<V> typeToken, @NonNull TypeLiaison.Handshake handshake) Attempts 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.
- Type Parameters:
V- the type being requested- Parameters:
typeToken- the type tokenhandshake- the handshake- Returns:
- the agent if supported, or null otherwise
- Throws:
DeveloperMistakeException- if the type has been annotated in a disallowed way for example by specifying contradictory annotations, or if a method onhandshakethrew such an exception
-