Class IdsOptions
java.lang.Object
org.brapi.schematools.core.graphql.options.IdsOptions
- All Implemented Interfaces:
Options,Validatable
Provides options for the generation of Ids
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetIdFieldFor(BrAPIObjectProperty property) Gets the converted id link property name for a propertygetIDFieldFor(String name) Gets the id field name for a specific primary model.getIDFieldFor(@NonNull BrAPIType type) Gets the id field name for a specific primary model.getIdsFieldFor(BrAPIObjectProperty property) Gets the converted ids link property name for a propertyfinal StringgetNameFor(@NonNull String name) Gets the name of the id for a specific primary modelfinal StringgetNameFor(@NonNull BrAPIType type) Gets the name of id for a specific primary model.booleanDetermines if the built-in GraphQLID type should be used for IDs instead of GraphQLStringvoidoverride(IdsOptions overrideOptions) Overrides the values in this Options Object from the provided Options Object if they are non-nullsetIDFieldFor(String name, String idField) Sets the id field name for a specific primary model.validate()Checks if the Validatable object is valid, return a list of errors if it is not valid
-
Constructor Details
-
IdsOptions
public IdsOptions()
-
-
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
-
isUsingIDType
public boolean isUsingIDType()Determines if the built-in GraphQLID type should be used for IDs instead of GraphQLString- Returns:
trueif the built-in GraphQLID type should be used for IDs instead of GraphQLString,falseotherwise
-
getNameFor
Gets the name of the id for a specific primary model- Parameters:
name- the name of the primary model- Returns:
- the name of the id for a specific primary model
-
getNameFor
Gets the name of id for a specific primary model. UsesetIDFieldFor(java.lang.String, java.lang.String)to override this value.- Parameters:
type- the primary model- Returns:
- the name of the id for a specific primary model
-
getIDFieldFor
Gets the id field name for a specific primary model. For example the id field name of Study, would be 'studyDbiId' by default. UsesetIDFieldFor(java.lang.String, java.lang.String)to override this value.- Parameters:
name- the name of the primary model- Returns:
- id parameter name for a specific primary model
-
getIDFieldFor
Gets the id field name for a specific primary model. For example the id field name of Study, would be 'studyDbiId' by default. UsesetIDFieldFor(java.lang.String, java.lang.String)to override this value.- Parameters:
type- the primary model- Returns:
- id parameter name for a specific primary model
-
setIDFieldFor
Sets the id field name for a specific primary model. For example the id field name of Study, would be 'studyDbiId' by default.- Parameters:
name- the name of the primary modelidField- the id field name for a specific primary model.- Returns:
- the options for chaining
-
getIdFieldFor
Gets the converted id link property name for a property- Parameters:
property- The BrAPI property- Returns:
- the converted property name that is used to return an id
-
getIdsFieldFor
Gets the converted ids link property name for a property- Parameters:
property- The BrAPI property- Returns:
- the converted property name that is used to return an array of ids
-