Package io.protostuff.runtime
Interface NumericIdStrategy.Registry
- All Known Implementing Classes:
ExplicitIdStrategy.Registry
,IncrementalIdStrategy.Registry
- Enclosing class:
NumericIdStrategy
public static interface NumericIdStrategy.Registry
Register your pojos/enums/collections/maps/delegates here.
-
Method Summary
Modifier and TypeMethodDescriptionIf you are sure that you are only using a single implementation of your interface/abstract class, then it makes sense to map it directly to its impl class to avoid writing the type.<T extends Collection<?>>
NumericIdStrategy.RegistryregisterCollection
(CollectionSchema.MessageFactory factory, int id) Collection ids start at 1.registerDelegate
(Delegate<T> delegate, int id) Register aDelegate
and assign an id.registerEnum
(EnumIO<?> eio, int id) Enum ids start at 1.<T extends Enum<T>>
NumericIdStrategy.RegistryregisterEnum
(Class<T> clazz, int id) Enum ids start at 1.<T extends Map<?,
?>>
NumericIdStrategy.RegistryregisterMap
(MapSchema.MessageFactory factory, int id) Map ids start at 1.registerPojo
(Schema<T> schema, Pipe.Schema<T> pipeSchema, int id) Pojo ids start at 1.registerPojo
(Class<T> clazz, int id) Pojo ids start at 1.
-
Method Details
-
registerCollection
<T extends Collection<?>> NumericIdStrategy.Registry registerCollection(CollectionSchema.MessageFactory factory, int id) Collection ids start at 1. -
registerMap
<T extends Map<?,?>> NumericIdStrategy.Registry registerMap(MapSchema.MessageFactory factory, int id) Map ids start at 1. -
registerEnum
Enum ids start at 1. -
registerEnum
Enum ids start at 1. -
registerPojo
Pojo ids start at 1. -
registerPojo
Pojo ids start at 1. -
mapPojo
If you are sure that you are only using a single implementation of your interface/abstract class, then it makes sense to map it directly to its impl class to avoid writing the type.Note that the type is always written when your field is
Object
.Pojo ids start at 1.
-
registerDelegate
Register aDelegate
and assign an id.Delegate ids start at 1.
-