Annotation Type Property


  • @Retention(RUNTIME)
    @Target({FIELD,PARAMETER})
    public @interface Property
    Field and parameter level annotation defining a property of the class. (identified by DataType) Can also be used on the parameters of transaction functions

    Example of using this annotation

    
     // max 15 character string, a-z with spaces
     @Property(schema = {"pattern", "^[a-zA-Z\\s]{0,15}$"})
     private String text;
    
     // How friendly is this on a scale of 1-5, 1 being formal, 5 being familiar
     @Property(schema = {"minimum", "1", "maximum", "5"})
     private int friendliness = 1;
    
     
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.String[] schema
      Allows each property to be defined a detail set of rules to determine the valid types of this data.
    • Element Detail

      • schema

        java.lang.String[] schema
        Allows each property to be defined a detail set of rules to determine the valid types of this data. The format follows the syntax of the OpenAPI Schema object.
        Returns:
        String array of the key-value pairs of the schema
        Default:
        {}