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.

  • 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 token
      handshake - 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 on handshake threw such an exception