Class PropertyOptions
java.lang.Object
org.brapi.schematools.core.options.PropertyOptions
- All Implemented Interfaces:
Options,Validatable
Provides options for the generation of property and their usage
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the plural property name for a specific primary model.Gets the plural property name for a specific primary model.getPropertyNameFor(String name) Gets the property name for a specific primary model.getPropertyNameFor(BrAPIType type) Gets the property name for a specific primary model.booleanisLink()Get if this property is used as a foreign key link between entitiesvoidoverride(PropertyOptions overrideOptions) Overrides the values in this Options Object from the provided Options Object if they are non-nullsetPluralPropertyNameFor(String name, String parameterName) Sets the plural property name for a specific primary model.setPluralPropertyNameFor(BrAPIType type, String idParameter) Sets the plural property name for a specific primary model.setPropertyNameFor(String name, String parameterName) Sets the property name for a specific primary model.setPropertyNameFor(BrAPIType type, String parameterName) Sets the property name for a specific primary model.validate()Checks if the Validatable object is valid, return a list of errors if it is not validMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.brapi.schematools.core.options.Options
getSchemaToolsVersion
-
Constructor Details
-
PropertyOptions
public PropertyOptions()
-
-
Method Details
-
validate
Description copied from interface:ValidatableChecks if the Validatable object is valid, return a list of errors if it is not valid- Specified by:
validatein interfaceValidatable- 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
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:
trueif this property is used as a foreign key link between entities,falseotherwise
-
getPropertyNameFor
Gets the property name for a specific primary model. For example the id property (or field) name of Study, would be 'studyDbId' by default. UsesetPropertyNameFor(String, String)to override this value.- Parameters:
name- the name of the primary model- Returns:
- property name for a specific primary model
-
getPropertyNameFor
Gets the property name for a specific primary model. For example the id property (or field) name of Study, would be 'studyDbId' by default. UsesetPropertyNameFor(String, String)to override this value.- Parameters:
type- the primary model- Returns:
- property name for a specific primary model
-
setPropertyNameFor
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 modelparameterName- the property name for a specific primary model.- Returns:
- the options for chaining
-
setPropertyNameFor
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 modelparameterName- the property name for a specific primary model.- Returns:
- the options for chaining
-
getPluralPropertyNameFor
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. UsesetPluralPropertyNameFor(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
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. UsesetPluralPropertyNameFor(java.lang.String, java.lang.String)to override this value.- Parameters:
type- the primary model- Returns:
- property name for a specific primary model
-
setPluralPropertyNameFor
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 modelparameterName- the plural property name for a specific primary model.- Returns:
- the options for chaining
-
setPluralPropertyNameFor
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 modelidParameter- the plural property name for a specific primary model.- Returns:
- the options for chaining
-