Class IdsOptions

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

public class IdsOptions extends Object implements Options
Provides options for the generation of Ids
  • Constructor Details

    • IdsOptions

      public IdsOptions()
  • 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(IdsOptions 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
    • isUsingIDType

      public boolean isUsingIDType()
      Determines if the built-in GraphQLID type should be used for IDs instead of GraphQLString
      Returns:
      true if the built-in GraphQLID type should be used for IDs instead of GraphQLString, false otherwise
    • getNameFor

      public final String getNameFor(@NonNull @NonNull String name)
      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

      public final String getNameFor(@NonNull @NonNull BrAPIType type)
      Gets the name of id for a specific primary model. Use setIDFieldFor(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

      public String getIDFieldFor(String name)
      Gets the id field name for a specific primary model. For example the id field name of Study, would be 'studyDbiId' by default. Use setIDFieldFor(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

      public String getIDFieldFor(@NonNull @NonNull BrAPIType type)
      Gets the id field name for a specific primary model. For example the id field name of Study, would be 'studyDbiId' by default. Use setIDFieldFor(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

      public IdsOptions setIDFieldFor(String name, String idField)
      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 model
      idField - the id field name for a specific primary model.
      Returns:
      the options for chaining
    • getIdFieldFor

      public String getIdFieldFor(BrAPIObjectProperty property)
      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

      public String getIdsFieldFor(BrAPIObjectProperty property)
      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