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

## Class GryoMapper

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

- All Implemented Interfaces:
    Mapper<Kryo>

      public final class GryoMapper
      extends Object
      implements Mapper<Kryo>

  A `Mapper` implementation for Kryo. This implementation requires that all classes to be serialized by Kryo are registered to it.

  `Graph` implementations providing an `IoRegistry` should register their custom classes and/or serializers in one of three ways:

  1. Register just the custom class with a `null` `Serializer` implementation
  2. Register the custom class with a `Serializer` implementation
  3. Register the custom class with a `Function<Kryo, Serializer>` for those cases where the `Serializer` requires the `Kryo` instance to get constructed.

  For example:

       public class MyGraphIoRegistry extends AbstractIoRegistry {
         public MyGraphIoRegistry() {
           register(GryoIo.class, MyGraphIdClass.class, new MyGraphIdSerializer());
         }
       }

  Author:
    Stephen Mallette (http://stephen.genoprime.com)

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `GryoMapper.Builder` A builder to construct a `GryoMapper` instance.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static byte[]` | `GIO`
    `static byte[]` | `HEADER`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static GryoMapper.Builder` | `build()`
    `Kryo` | `createMapper()` Create a new instance of the internal object mapper that an implementation represents.
    `List<Class>` | `getRegisteredClasses()`
    `List<TypeRegistration<?>>` | `getTypeRegistrations()`
    `GryoVersion` | `getVersion()`

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

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

- - ### Field Detail

    - #### GIO

          public static final byte[] GIO

    - #### HEADER

          public static final byte[] HEADER

  - ### Method Detail

    - #### createMapper

          public Kryo createMapper()

      Description copied from interface: `Mapper`
      Create a new instance of the internal object mapper that an implementation represents.
      Specified by:
        `createMapper` in interface `Mapper<Kryo>`

    - #### getVersion

          public GryoVersion getVersion()

    - #### getRegisteredClasses

          public List<Class> getRegisteredClasses()

    - #### getTypeRegistrations

          public List<TypeRegistration<?>> getTypeRegistrations()

    - #### build

          public static GryoMapper.Builder build()

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