/** * 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. */ public Builder addCustom(final Class... custom) { if (custom != null && custom.length > 0) { for (Class c : custom) { addOrOverrideRegistration(c, id -> GryoTypeReg.of(c, id)); } } return this; }
/** * Register a custom class to serialize with a custom serializer as returned from a {@link Function}. Note * that calling this method for a class that is already registered will override that registration. */ public Builder addCustom(final Class clazz, final Function<Kryo, Serializer> functionOfKryo) { addOrOverrideRegistration(clazz, id -> GryoTypeReg.of(clazz, id, functionOfKryo)); return this; }
/** * Register custom class to serialize with a custom serialization shim. */ public Builder addCustom(final Class clazz, final SerializerShim serializer) { addOrOverrideRegistration(clazz, id -> GryoTypeReg.of(clazz, id, serializer)); return this; }
/** * 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. */ public Builder addCustom(final Class clazz, final Serializer serializer) { addOrOverrideRegistration(clazz, id -> GryoTypeReg.of(clazz, id, serializer)); return this; }
/** * Register custom class to serialize with a custom serialization shim. */ public Builder addCustom(final Class clazz, final SerializerShim serializer) { addOrOverrideRegistration(clazz, id -> GryoTypeReg.of(clazz, id, serializer)); return this; }
/** * 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. */ public Builder addCustom(final Class clazz, final Serializer serializer) { addOrOverrideRegistration(clazz, id -> GryoTypeReg.of(clazz, id, serializer)); return this; }
/** * 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. */ public Builder addCustom(final Class... custom) { if (custom != null && custom.length > 0) { for (Class c : custom) { addOrOverrideRegistration(c, id -> GryoTypeReg.of(c, id)); } } return this; }
/** * Register a custom class to serialize with a custom serializer as returned from a {@link Function}. Note * that calling this method for a class that is already registered will override that registration. */ public Builder addCustom(final Class clazz, final Function<Kryo, Serializer> functionOfKryo) { addOrOverrideRegistration(clazz, id -> GryoTypeReg.of(clazz, id, functionOfKryo)); return this; }