Uses of Class com.fasterxml.jackson.annotation.ObjectIdGenerator (Jackson-annotations 2.12.0 API)
Date: 2020-11-28

## Uses of Class
com.fasterxml.jackson.annotation.ObjectIdGenerator

- - ### Uses of ObjectIdGenerator in com.fasterxml.jackson.annotation

    Subclasses of ObjectIdGenerator in com.fasterxml.jackson.annotation
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `ObjectIdGenerators.IntSequenceGenerator` Simple sequence-number based generator, which uses basic Java `int`s (starting with value 1) as Object Identifiers.
    `static class` | `ObjectIdGenerators.None` Abstract marker class used to allow explicitly specifying that no generator is used; which also implies that no Object Id is to be included or used.
    `static class` | `ObjectIdGenerators.PropertyGenerator` Abstract place-holder class which is used to denote case where Object Identifier to use comes from a POJO property (getter method or field).
    `static class` | `ObjectIdGenerators.StringIdGenerator` Implementation that will accept arbitrary (but unique) String Ids on deserialization, and (by default) use random UUID generation similar to `ObjectIdGenerators.UUIDGenerator` for generation ids.
    `static class` | `ObjectIdGenerators.UUIDGenerator` Implementation that just uses `UUID`s as reliably unique identifiers: downside is that resulting String is 36 characters long.

    Methods in com.fasterxml.jackson.annotation that return ObjectIdGenerator
    Modifier and Type | Method and Description
    --- | ---
    `ObjectIdGenerator<Integer>` | ObjectIdGenerators.IntSequenceGenerator.`forScope(Class<?> scope)`
    `ObjectIdGenerator<UUID>` | ObjectIdGenerators.UUIDGenerator.`forScope(Class<?> scope)` Can just return base instance since this is essentially scopeless
    `ObjectIdGenerator<String>` | ObjectIdGenerators.StringIdGenerator.`forScope(Class<?> scope)`
    `abstract ObjectIdGenerator<T>` | ObjectIdGenerator.`forScope(Class<?> scope)` Factory method to create a blueprint instance for specified scope.
    `ObjectIdGenerator<Integer>` | ObjectIdGenerators.IntSequenceGenerator.`newForSerialization(Object context)`
    `ObjectIdGenerator<UUID>` | ObjectIdGenerators.UUIDGenerator.`newForSerialization(Object context)` Can just return base instance since this is essentially scopeless
    `ObjectIdGenerator<String>` | ObjectIdGenerators.StringIdGenerator.`newForSerialization(Object context)`
    `abstract ObjectIdGenerator<T>` | ObjectIdGenerator.`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 in com.fasterxml.jackson.annotation with parameters of type ObjectIdGenerator
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | ObjectIdGenerators.UUIDGenerator.`canUseFor(ObjectIdGenerator<?> gen)` Since UUIDs are always unique, let's fully ignore scope definition
    `boolean` | ObjectIdGenerators.StringIdGenerator.`canUseFor(ObjectIdGenerator<?> gen)`
    `abstract boolean` | ObjectIdGenerator.`canUseFor(ObjectIdGenerator<?> gen)` Method called to check whether this generator instance can be used for Object Ids of specific generator type and scope; determination is based by passing a configured "blueprint" (prototype) instance; from which the actual instances are created (using `newForSerialization(java.lang.Object)`).

Copyright © 2008–2020 FasterXML. All rights reserved.