Package com.fasterxml.jackson.annotation
Class ObjectIdGenerators.IntSequenceGenerator
- java.lang.Object
-
- com.fasterxml.jackson.annotation.ObjectIdGenerator<T>
-
- com.fasterxml.jackson.annotation.ObjectIdGenerators.IntSequenceGenerator
-
- All Implemented Interfaces:
java.io.Serializable
- Enclosing class:
- ObjectIdGenerators
public static final class ObjectIdGenerators.IntSequenceGenerator extends ObjectIdGenerator<T>
Simple sequence-number based generator, which uses basic Javaints (starting with value 1) as Object Identifiers.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.fasterxml.jackson.annotation.ObjectIdGenerator
ObjectIdGenerator.IdKey
-
-
Field Summary
Fields Modifier and Type Field Description protected int_nextValue
-
Constructor Summary
Constructors Constructor Description IntSequenceGenerator()IntSequenceGenerator(java.lang.Class<?> scope, int fv)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectIdGenerator<java.lang.Integer>forScope(java.lang.Class<?> scope)Factory method to create a blueprint instance for specified scope.java.lang.IntegergenerateId(java.lang.Object forPojo)Method used for generating a new Object Identifier to serialize for given POJO.protected intinitialValue()ObjectIdGenerator.IdKeykey(java.lang.Object key)Method for constructing key to use for ObjectId-to-POJO maps.ObjectIdGenerator<java.lang.Integer>newForSerialization(java.lang.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 com.fasterxml.jackson.annotation.ObjectIdGenerator
isValidReferencePropertyName, maySerializeAsObject
-
-
-
-
Method Detail
-
initialValue
protected int initialValue()
-
forScope
public ObjectIdGenerator<java.lang.Integer> forScope(java.lang.Class<?> scope)
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<java.lang.Integer>
-
newForSerialization
public ObjectIdGenerator<java.lang.Integer> newForSerialization(java.lang.Object context)
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<java.lang.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
public ObjectIdGenerator.IdKey key(java.lang.Object key)
Description copied from class:ObjectIdGeneratorMethod for constructing key to use for ObjectId-to-POJO maps.- Specified by:
keyin classObjectIdGenerator<java.lang.Integer>
-
generateId
public java.lang.Integer generateId(java.lang.Object forPojo)
Description copied from class:ObjectIdGeneratorMethod used for generating a new Object Identifier to serialize for given POJO.- Parameters:
forPojo- POJO for which identifier is needed- Returns:
- Object Identifier to use.
-
-