Annotation Interface BsonDiscriminator


@Inherited @Documented @Retention(RUNTIME) @Target(TYPE) public @interface BsonDiscriminator
An annotation that configures the discriminator key and value for a class.

For POJOs, requires the Conventions.ANNOTATION_CONVENTION

For Java records, the annotation is not supported.

Since:
3.5
See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
     
     
  • Element Details

    • value

      String value
      Returns:
      the discriminator value to use for this type.
      Default:
      ""
    • key

      String key
      Returns:
      the discriminator key to use for this type.
      Default:
      "_t"