Annotation Type Present


The annotated JsonNullable must be present, that is not undefined. An explicit null value is present and therefore valid; a null reference is not.

The value extractor of this module unwraps JsonNullable by default, so the constraint only sees the wrapper when unwrapping is skipped at the place of use:

 @Present(payload = Unwrapping.Skip.class)
 private JsonNullable<String> color = JsonNullable.undefined();
 
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static @interface 
    Defines several Present annotations on the same element.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Class<?>[]
     
     
    Class<? extends jakarta.validation.Payload>[]
     
  • Element Details

    • message

      String message
      Default:
      "must be present"
    • groups

      Class<?>[] groups
      Default:
      {}
    • payload

      Class<? extends jakarta.validation.Payload>[] payload
      Default:
      {}