Interface PofContext

All Superinterfaces:
Serializer
All Known Implementing Classes:
ConfigurablePofContext, NullImplementation.NullPofContext, SafeConfigurablePofContext, SimplePofContext

public interface PofContext extends Serializer
The PofContext interface represents a set of user types that can be serialized to and deserialized from a POF stream.
Since:
Coherence 3.2
Author:
cp/jh 2006.07.11
  • Method Summary

    Modifier and Type
    Method
    Description
    getClass(int nTypeId)
    Determine the class associated with the given user type identifier.
    getClassName(int nTypeId)
    Determine the name of the class associated with the given user type identifier.
    getPofSerializer(int nTypeId)
    Return a PofSerializer that can be used to serialize and deserialize an object of the specified user type to and from a POF stream.
    int
    Determine the user type identifier associated with the given class.
    int
    Determine the user type identifier associated with the given object.
    int
    Determine the user type identifier associated with the given class name.
    default boolean
    Return true if PofReader.readObject(int) method should return the appropriate Java 8 date/time type, or false if a legacy date/time types should be returned in order to preserve backwards compatibility.
    boolean
    Determine if the given class is a user type known to this PofContext.
    boolean
    Determine if the given object is of a user type known to this PofContext.
    boolean
    Determine if the class with the given name is a user type known to this PofContext.

    Methods inherited from interface com.tangosol.io.Serializer

    deserialize, deserialize, getName, serialize
  • Method Details

    • getPofSerializer

      PofSerializer getPofSerializer(int nTypeId)
      Return a PofSerializer that can be used to serialize and deserialize an object of the specified user type to and from a POF stream.
      Parameters:
      nTypeId - the type identifier of the user type that can be serialized and deserialized using the returned PofSerializer; must be non-negative
      Returns:
      a PofSerializer for the specified user type
      Throws:
      IllegalArgumentException - if the specified user type is negative or unknown to this PofContext
    • getUserTypeIdentifier

      int getUserTypeIdentifier(Object o)
      Determine the user type identifier associated with the given object.
      Parameters:
      o - an instance of a user type; must not be null
      Returns:
      the type identifier of the user type associated with the given object
      Throws:
      IllegalArgumentException - if the user type associated with the given object is unknown to this PofContext or if the object is null
    • getUserTypeIdentifier

      int getUserTypeIdentifier(Class clz)
      Determine the user type identifier associated with the given class.
      Parameters:
      clz - a user type class; must not be null
      Returns:
      the type identifier of the user type associated with the given class
      Throws:
      IllegalArgumentException - if the user type associated with the given class is unknown to this PofContext or if the class is null
    • getUserTypeIdentifier

      int getUserTypeIdentifier(String sClass)
      Determine the user type identifier associated with the given class name.
      Parameters:
      sClass - the name of a user type class; must not be null
      Returns:
      the type identifier of the user type associated with the given class name
      Throws:
      IllegalArgumentException - if the user type associated with the given class name is unknown to this PofContext or if the class name is null
    • getClassName

      String getClassName(int nTypeId)
      Determine the name of the class associated with the given user type identifier.
      Parameters:
      nTypeId - the user type identifier; must be non-negative
      Returns:
      the name of the class associated with the specified user type identifier
      Throws:
      IllegalArgumentException - if the specified user type is negative or unknown to this PofContext
    • getClass

      Class getClass(int nTypeId)
      Determine the class associated with the given user type identifier.
      Parameters:
      nTypeId - the user type identifier; must be non-negative
      Returns:
      the class associated with the specified user type identifier
      Throws:
      IllegalArgumentException - if the specified user type is negative or unknown to this PofContext
    • isUserType

      boolean isUserType(Object o)
      Determine if the given object is of a user type known to this PofContext.
      Parameters:
      o - the object to test; must not be null
      Returns:
      true iff the specified object is of a valid user type
      Throws:
      IllegalArgumentException - if the given object is null
    • isUserType

      boolean isUserType(Class clz)
      Determine if the given class is a user type known to this PofContext.
      Parameters:
      clz - the class to test; must not be null
      Returns:
      true iff the specified class is a valid user type
      Throws:
      IllegalArgumentException - if the given class is null
    • isUserType

      boolean isUserType(String sClass)
      Determine if the class with the given name is a user type known to this PofContext.
      Parameters:
      sClass - the name of the class to test; must not be null
      Returns:
      true iff the class with the specified name is a valid user type
      Throws:
      IllegalArgumentException - if the given class name is null
    • isPreferJavaTime

      default boolean isPreferJavaTime()
      Return true if PofReader.readObject(int) method should return the appropriate Java 8 date/time type, or false if a legacy date/time types should be returned in order to preserve backwards compatibility.
      Returns:
      true if Java 8 date/time types should be preferred over legacy types