Annotation Interface Attribute


@Retention(RUNTIME) @Target(FIELD) public @interface Attribute
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
     
    boolean
    Shortcut: the String value must be a valid email address.
    int
     
    double
    Maximum allowed value for a numeric attribute.
    double
    Minimum allowed value for a numeric attribute.
    int
    Minimum length for a String attribute.
     
    A regex the String value must fully match.
    int
     
    Former names of this attribute, so the schema upgrader can rename the existing column (keeping its data) instead of adding a fresh empty one.
    boolean
     
    int
     
    boolean
    Marks a String attribute as sensitive (a credential, API key, password, …).
  • Element Details

    • name

      String name
      Default:
      ""
    • displayName

      String displayName
      Default:
      ""
    • previousNames

      String[] previousNames
      Former names of this attribute, so the schema upgrader can rename the existing column (keeping its data) instead of adding a fresh empty one. List the old field/attribute name as it was written in Java (e.g. "phone" after renaming the field to phoneNumber); it is mapped to a column name through the same naming strategy. Keep at least the most recent former name until every deployment has migrated.
      Default:
      {}
    • length

      int length
      Default:
      255
    • required

      boolean required
      Default:
      false
    • precision

      int precision
      Default:
      15
    • scale

      int scale
      Default:
      2
    • min

      double min
      Minimum allowed value for a numeric attribute. NaN (default) means no bound.
      Default:
      0.0/0.0
    • max

      double max
      Maximum allowed value for a numeric attribute. NaN (default) means no bound.
      Default:
      0.0/0.0
    • minLength

      int minLength
      Minimum length for a String attribute. 0 (default) means no minimum. (length() is the max.)
      Default:
      0
    • pattern

      String pattern
      A regex the String value must fully match. Empty (default) means no pattern.
      Default:
      ""
    • email

      boolean email
      Shortcut: the String value must be a valid email address.
      Default:
      false
    • secret

      boolean secret
      Marks a String attribute as sensitive (a credential, API key, password, …). A secret attribute is encrypted at rest, never returned in the clear by the generic API (read responses carry a "set / not set" sentinel instead of the value), and rendered as a write-only password control in the UI. Only meaningful for String attributes; requires onec.security.secret-key to be configured.
      Default:
      false