Interface KeySerializer<T1,T2>

Type Parameters:
T1 - The type to be serialized from and deserialized to
T2 - The type to be serialized to and deserialized from
All Known Implementing Classes:
KeySerializer.NumberKey, KeySerializer.PlayerKey, KeySerializer.StringKey, KeySerializer.UuidKey

public interface KeySerializer<T1,T2>
Defines a contract for an object that performs serialization and deserialization between an advanced object and a simple "key" object.
Since:
0.1.0
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final class 
    Serializer for wrapped number primitives
    static final class 
    Serializer for player types
    static final class 
    Serializer for strings
    static final class 
    Serializer for UUIDs
  • Method Summary

    Modifier and Type
    Method
    Description
    deserialize(T2 input)
    Deserializes the "simple" key object into an "advanced" object type.
    serialize(T1 input)
    Serializes the "advanced" object into a "simple" key type.
  • Method Details

    • serialize

      T2 serialize(T1 input)
      Serializes the "advanced" object into a "simple" key type.
      Parameters:
      input - The advanced object
      Returns:
      The key representation
    • deserialize

      T1 deserialize(T2 input)
      Deserializes the "simple" key object into an "advanced" object type.
      Parameters:
      input - The key object
      Returns:
      The advanced representation