Class PropertyOptions

java.lang.Object
org.brapi.schematools.core.options.PropertyOptions
All Implemented Interfaces:
Options, Validatable

public class PropertyOptions extends Object implements Options
Provides options for the generation of property and their usage
  • Constructor Details

    • PropertyOptions

      public PropertyOptions()
  • Method Details

    • validate

      public Validation validate()
      Description copied from interface: Validatable
      Checks if the Validatable object is valid, return a list of errors if it is not valid
      Specified by:
      validate in interface Validatable
      Returns:
      a Validation object than can be used queried to find if the object is valid and any errors if it is not valid
    • override

      public void override(PropertyOptions overrideOptions)
      Overrides the values in this Options Object from the provided Options Object if they are non-null
      Parameters:
      overrideOptions - the options which will be used to override this Options Object
    • isLink

      public boolean isLink()
      Get if this property is used as a foreign key link between entities
      Returns:
      true if this property is used as a foreign key link between entities, false otherwise
    • getPropertyNameFor

      public String getPropertyNameFor(String name)
      Gets the property name for a specific primary model. For example the id property (or field) name of Study, would be 'studyDbId' by default. Use setPropertyNameFor(String, String) to override this value.
      Parameters:
      name - the name of the primary model
      Returns:
      property name for a specific primary model
    • getPropertyNameFor

      public String getPropertyNameFor(BrAPIType type)
      Gets the property name for a specific primary model. For example the id property (or field) name of Study, would be 'studyDbId' by default. Use setPropertyNameFor(String, String) to override this value.
      Parameters:
      type - the primary model
      Returns:
      property name for a specific primary model
    • setPropertyNameFor

      public PropertyOptions setPropertyNameFor(String name, String parameterName)
      Sets the property name for a specific primary model. For example the id property (or field) name of Study, would be 'studyDbId' by default.
      Parameters:
      name - the name of the primary model
      parameterName - the property name for a specific primary model.
      Returns:
      the options for chaining
    • setPropertyNameFor

      public PropertyOptions setPropertyNameFor(BrAPIType type, String parameterName)
      Sets the property name for a specific primary model. For example the id property (or field) name of Study, would be 'studyDbId' by default.
      Parameters:
      type - the primary model
      parameterName - the property name for a specific primary model.
      Returns:
      the options for chaining
    • getPluralPropertyNameFor

      public String getPluralPropertyNameFor(String name)
      Gets the plural property name for a specific primary model. For example the id property (or field) name of Study, would be 'studyDbId' by default. Use setPluralPropertyNameFor(java.lang.String, java.lang.String) to override this value.
      Parameters:
      name - the name of the primary model
      Returns:
      property name for a specific primary model
    • getPluralPropertyNameFor

      public String getPluralPropertyNameFor(BrAPIType type)
      Gets the plural property name for a specific primary model. For example the id property (or field) name of Study, would be 'studyDbId' by default. Use setPluralPropertyNameFor(java.lang.String, java.lang.String) to override this value.
      Parameters:
      type - the primary model
      Returns:
      property name for a specific primary model
    • setPluralPropertyNameFor

      public PropertyOptions setPluralPropertyNameFor(String name, String parameterName)
      Sets the plural property name for a specific primary model. For example the ids property (or field) name of Study, would be 'studyDbIds' by default.
      Parameters:
      name - the name of the primary model
      parameterName - the plural property name for a specific primary model.
      Returns:
      the options for chaining
    • setPluralPropertyNameFor

      public PropertyOptions setPluralPropertyNameFor(BrAPIType type, String idParameter)
      Sets the plural property name for a specific primary model. For example the id property (or field) name of Study, would be 'studyDbIds' by default.
      Parameters:
      type - the primary model
      idParameter - the plural property name for a specific primary model.
      Returns:
      the options for chaining