Class ObjectIdGenerators.IntSequenceGenerator
java.lang.Object
com.fasterxml.jackson.annotation.ObjectIdGenerator<Integer>
com.fasterxml.jackson.annotation.ObjectIdGenerators.Base<Integer>
com.fasterxml.jackson.annotation.ObjectIdGenerators.IntSequenceGenerator
- All Implemented Interfaces:
Serializable
- Enclosing class:
ObjectIdGenerators
public static final class ObjectIdGenerators.IntSequenceGenerator
extends ObjectIdGenerators.Base<Integer>
Simple sequence-number based generator, which uses basic Java
ints (starting with value 1) as Object Identifiers.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class ObjectIdGenerator
ObjectIdGenerator.IdKey -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprivate static final longFields inherited from class ObjectIdGenerators.Base
_scope -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionFactory method to create a blueprint instance for specified scope.generateId(Object forPojo) Method used for generating a new Object Identifier to serialize for given POJO.protected intMethod for constructing key to use for ObjectId-to-POJO maps.newForSerialization(Object context) Factory method called to create a new instance to use for serialization: needed since generators may have state (next id to produce).Methods inherited from class ObjectIdGenerators.Base
canUseFor, getScopeMethods inherited from class ObjectIdGenerator
isValidReferencePropertyName, maySerializeAsObject
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
_nextValue
protected transient int _nextValue
-
-
Constructor Details
-
IntSequenceGenerator
public IntSequenceGenerator() -
IntSequenceGenerator
-
-
Method Details
-
initialValue
protected int initialValue() -
forScope
Description copied from class:ObjectIdGeneratorFactory method to create a blueprint instance for specified scope. Generators that do not use scope may return 'this'.- Specified by:
forScopein classObjectIdGenerator<Integer>
-
newForSerialization
Description copied from class:ObjectIdGeneratorFactory method called to create a new instance to use for serialization: needed since generators may have state (next id to produce).Note that actual type of 'context' is
SerializerProvider(2.x) /SerializationContext(3.x), but can not be declared here as type itself (as well as call to this object) comes from databind package.- Specified by:
newForSerializationin classObjectIdGenerator<Integer>- Parameters:
context- Serialization context object used (of typeSerializerProvider(2.x) /SerializationContext(3.x)); may be needed by more complex generators to access contextual information such as configuration.
-
key
Description copied from class:ObjectIdGeneratorMethod for constructing key to use for ObjectId-to-POJO maps.- Specified by:
keyin classObjectIdGenerator<Integer>
-
generateId
Description copied from class:ObjectIdGeneratorMethod used for generating a new Object Identifier to serialize for given POJO.- Specified by:
generateIdin classObjectIdGenerators.Base<Integer>- Parameters:
forPojo- POJO for which identifier is needed- Returns:
- Object Identifier to use.
-