Interface TypeLiaison.Handshake

Enclosing interface:
TypeLiaison

public static interface TypeLiaison.Handshake
Callback interface allowing TypeLiaison.Agent to access certain resources
  • Method Details

    • getOtherSerializer

      @SideEffectFree <U> @NonNull SerializeDeserialize<U> getOtherSerializer(@NonNull TypeToken<U> other)
      Gets another serializer. This function allows serializers to "depend" on each other by using instances of other serializers.
      Type Parameters:
      U - the type requested
      Parameters:
      other - the type being requested
      Returns:
      a serializer for it
      Throws:
      DeveloperMistakeException - if no liaison handles the requested type
      IllegalStateException - if a cyclic loop is detected with the other liaison
    • getConfiguration

      @SideEffectFree <U> @NonNull ConfigurationDefinition<U> getConfiguration(@NonNull TypeToken<U> other)
      Gets another configuration. This function will use the settings from the parent configuration for purposes of defining, deserializing/serializing, and instantiating the child.
      Type Parameters:
      U - the type requested
      Parameters:
      other - the type whose definition is requested
      Returns:
      a configuration which can be read or written
      Throws:
      DeveloperMistakeException - if the type requested is improperly declared or has broken settings
      IllegalStateException - if a cyclic loop is detected with the requested type