org.apache.tinkerpop.gremlin.structure.io.gryo

## Class AbstractGryoClassResolver

- java.lang.Object
- - org.apache.tinkerpop.gremlin.structure.io.gryo.AbstractGryoClassResolver

- All Implemented Interfaces:
    org.apache.tinkerpop.shaded.kryo.ClassResolver
  Direct Known Subclasses:
    GryoClassResolverV1d0, GryoClassResolverV3d0

      public abstract class AbstractGryoClassResolver
      extends Object
      implements org.apache.tinkerpop.shaded.kryo.ClassResolver

  This mapper implementation of the `ClassResolver` helps ensure that all Vertex and Edge concrete classes get properly serialized and deserialized by stripping them of their concrete class name so that they are treated generically. See the `getRegistration(Class)` method for the core of this logic.
  Author:
    Stephen Mallette (http://stephen.genoprime.com)

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected org.apache.tinkerpop.shaded.kryo.util.IdentityObjectIntMap<Class>` | `classToNameId`
    `protected org.apache.tinkerpop.shaded.kryo.util.ObjectMap<Class,org.apache.tinkerpop.shaded.kryo.Registration>` | `classToRegistration`
    `protected org.apache.tinkerpop.shaded.kryo.util.IntMap<org.apache.tinkerpop.shaded.kryo.Registration>` | `idToRegistration`
    `protected org.apache.tinkerpop.shaded.kryo.Kryo` | `kryo`
    `static byte` | `NAME`
    `protected org.apache.tinkerpop.shaded.kryo.util.IntMap<Class>` | `nameIdToClass`
    `protected org.apache.tinkerpop.shaded.kryo.util.ObjectMap<String,Class>` | `nameToClass`
    `protected int` | `nextNameId`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractGryoClassResolver()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract Class` | `coerceType(Class clazz)` Called from `getRegistration(Class)` to determine the actual type.
    `org.apache.tinkerpop.shaded.kryo.Registration` | `getRegistration(Class clazz)`
    `org.apache.tinkerpop.shaded.kryo.Registration` | `getRegistration(int classID)`
    `protected Class<?>` | `getTypeByName(String className)`
    `org.apache.tinkerpop.shaded.kryo.Registration` | `readClass(org.apache.tinkerpop.shaded.kryo.io.Input input)`
    `protected org.apache.tinkerpop.shaded.kryo.Registration` | `readName(org.apache.tinkerpop.shaded.kryo.io.Input input)`
    `org.apache.tinkerpop.shaded.kryo.Registration` | `register(org.apache.tinkerpop.shaded.kryo.Registration registration)`
    `org.apache.tinkerpop.shaded.kryo.Registration` | `registerImplicit(Class type)`
    `void` | `reset()`
    `void` | `setKryo(org.apache.tinkerpop.shaded.kryo.Kryo kryo)`
    `org.apache.tinkerpop.shaded.kryo.Registration` | `writeClass(org.apache.tinkerpop.shaded.kryo.io.Output output, Class type)`
    `protected void` | `writeName(org.apache.tinkerpop.shaded.kryo.io.Output output, Class type)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### NAME

          public static final byte NAME

      See Also:
        Constant Field Values

    - #### kryo

          protected org.apache.tinkerpop.shaded.kryo.Kryo kryo

    - #### idToRegistration

          protected final org.apache.tinkerpop.shaded.kryo.util.IntMap<org.apache.tinkerpop.shaded.kryo.Registration> idToRegistration

    - #### classToRegistration

          protected final org.apache.tinkerpop.shaded.kryo.util.ObjectMap<Class,org.apache.tinkerpop.shaded.kryo.Registration> classToRegistration

    - #### classToNameId

          protected org.apache.tinkerpop.shaded.kryo.util.IdentityObjectIntMap<Class> classToNameId

    - #### nameIdToClass

          protected org.apache.tinkerpop.shaded.kryo.util.IntMap<Class> nameIdToClass

    - #### nameToClass

          protected org.apache.tinkerpop.shaded.kryo.util.ObjectMap<String,Class> nameToClass

    - #### nextNameId

          protected int nextNameId

  - ### Constructor Detail

    - #### AbstractGryoClassResolver

          public AbstractGryoClassResolver()

  - ### Method Detail

    - #### setKryo

          public void setKryo(org.apache.tinkerpop.shaded.kryo.Kryo kryo)

      Specified by:
        `setKryo` in interface `org.apache.tinkerpop.shaded.kryo.ClassResolver`

    - #### register

          public org.apache.tinkerpop.shaded.kryo.Registration register(org.apache.tinkerpop.shaded.kryo.Registration registration)

      Specified by:
        `register` in interface `org.apache.tinkerpop.shaded.kryo.ClassResolver`

    - #### registerImplicit

          public org.apache.tinkerpop.shaded.kryo.Registration registerImplicit(Class type)

      Specified by:
        `registerImplicit` in interface `org.apache.tinkerpop.shaded.kryo.ClassResolver`

    - #### coerceType

          public abstract Class coerceType(Class clazz)

      Called from `getRegistration(Class)` to determine the actual type.

    - #### getRegistration

          public org.apache.tinkerpop.shaded.kryo.Registration getRegistration(Class clazz)

      Specified by:
        `getRegistration` in interface `org.apache.tinkerpop.shaded.kryo.ClassResolver`

    - #### getRegistration

          public org.apache.tinkerpop.shaded.kryo.Registration getRegistration(int classID)

      Specified by:
        `getRegistration` in interface `org.apache.tinkerpop.shaded.kryo.ClassResolver`

    - #### writeClass

          public org.apache.tinkerpop.shaded.kryo.Registration writeClass(org.apache.tinkerpop.shaded.kryo.io.Output output,
                                                                          Class type)

      Specified by:
        `writeClass` in interface `org.apache.tinkerpop.shaded.kryo.ClassResolver`

    - #### writeName

          protected void writeName(org.apache.tinkerpop.shaded.kryo.io.Output output,
                                   Class type)

    - #### readClass

          public org.apache.tinkerpop.shaded.kryo.Registration readClass(org.apache.tinkerpop.shaded.kryo.io.Input input)

      Specified by:
        `readClass` in interface `org.apache.tinkerpop.shaded.kryo.ClassResolver`

    - #### readName

          protected org.apache.tinkerpop.shaded.kryo.Registration readName(org.apache.tinkerpop.shaded.kryo.io.Input input)

    - #### getTypeByName

          protected Class<?> getTypeByName(String className)

    - #### reset

          public void reset()

      Specified by:
        `reset` in interface `org.apache.tinkerpop.shaded.kryo.ClassResolver`

Copyright © 2013–2022 Apache Software Foundation. All rights reserved.