Class GryoMapper.Builder

    • Method Detail

      • classResolver

        public GryoMapper.Builder classResolver​(Supplier<org.apache.tinkerpop.shaded.kryo.ClassResolver> classResolverSupplier)
        Provides a custom Kryo ClassResolver to be supplied to a Kryo instance. If this value is not supplied then it will default to the ClassResolver of the provided GryoVersion. To ensure compatibility with Gryo it is highly recommended that objects passed to this method extend that class.

        If the ClassResolver implementation share state, then the Supplier should typically create new instances when requested, as the Supplier will be called for each Kryo instance created.

      • addCustom

        public GryoMapper.Builder addCustom​(Class... custom)
        Register custom classes to serializes with gryo using default serialization. Note that calling this method for a class that is already registered will override that registration.
      • addCustom

        public GryoMapper.Builder addCustom​(Class clazz,
                                            org.apache.tinkerpop.shaded.kryo.Serializer serializer)
        Register custom class to serialize with a custom serialization class. Note that calling this method for a class that is already registered will override that registration.
      • addCustom

        public GryoMapper.Builder addCustom​(Class clazz,
                                            Function<org.apache.tinkerpop.shaded.kryo.Kryo,​org.apache.tinkerpop.shaded.kryo.Serializer> functionOfKryo)
        Register a custom class to serialize with a custom serializer as returned from a Function. Note that calling this method for a class that is already registered will override that registration.
      • registrationRequired

        public GryoMapper.Builder registrationRequired​(boolean registrationRequired)
        When set to true, all classes serialized by the Kryo instances created from this GryoMapper must have their classes known up front and registered appropriately through this builder. By default this value is true. This approach is more efficient than setting the value to false.
        Parameters:
        registrationRequired - set to true if the classes should be registered up front or false otherwise
      • referenceTracking

        public GryoMapper.Builder referenceTracking​(boolean referenceTracking)
        By default, each appearance of an object in the graph after the first is stored as an integer ordinal. This allows multiple references to the same object and cyclic graphs to be serialized. This has a small amount of overhead and can be disabled to save space if it is not needed.
        Parameters:
        referenceTracking - set to true to enable and false otherwise
      • create

        public GryoMapper create()
        Creates a GryoMapper.