Class ControlledVocabularyOptions

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

public class ControlledVocabularyOptions extends Object implements Options
Provides options for the generation of Controlled Vocabulary Endpoints
  • Constructor Details

    • ControlledVocabularyOptions

      public ControlledVocabularyOptions()
  • Method Details

    • validate

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

      public void override(ControlledVocabularyOptions 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
    • isGenerating

      public final boolean isGenerating()
      Determines if the Endpoint/Query/Mutation is generated for any primary model. Returns true if generate is set to true or generateFor is set to true for any type
      Returns:
      true if the Generator should generate any Endpoints/Queries/Mutations, false otherwise
    • isGeneratingFor

      public final boolean isGeneratingFor(@NonNull @NonNull String typeName, @NonNull @NonNull String propertyName)
      Determines if the Endpoint is generated for a specific BrAPI Property
      Parameters:
      typeName - the name of the primary model
      propertyName - the name of the property
      Returns:
      true if the Endpoint specific BrAPI Property, false otherwise
    • isGeneratingFor

      public final boolean isGeneratingFor(@NonNull @NonNull BrAPIType type, @NonNull @NonNull BrAPIObjectProperty property)
      Determines if the Endpoint is generated for a specific BrAPI Property
      Parameters:
      type - the primary model
      property - the property
      Returns:
      true if the Endpoint specific BrAPI Property, false otherwise
    • isGeneratingFor

      public boolean isGeneratingFor(@NonNull @NonNull BrAPIObjectTypeWithProperty typeWithProperty)
      Determines if the Endpoint is generated for a specific BrAPI Property
      Parameters:
      typeWithProperty - the primary model with the property
      Returns:
      true if the Endpoint specific BrAPI Property, false otherwise
    • setGenerateFor

      public ControlledVocabularyOptions setGenerateFor(String typeName, String propertyName, boolean generate)
      Sets if the Endpoint is generated for a specific BrAPI Property
      Parameters:
      typeName - the name of the primary model
      propertyName - the name of the property
      generate - true if the Endpoint/Query/Mutation is generated for a specific BrAPI Property, false
      Returns:
      the options for chaining
    • setGenerateFor

      public ControlledVocabularyOptions setGenerateFor(@NonNull @NonNull BrAPIType type, @NonNull @NonNull BrAPIObjectProperty property, boolean generate)
      Sets if the Endpoint/Query/Mutation is generated for a specific primary model.
      Parameters:
      type - the primary model
      property - the property
      generate - true if the Endpoint/Query/Mutation is generated for a specific primary model, false
      Returns:
      the options for chaining
    • getDescriptionFor

      public final String getDescriptionFor(@NonNull @NonNull String typeName, @NonNull @NonNull String propertyName)
      Gets the description for a specific primary model
      Parameters:
      typeName - the name of the primary model
      propertyName - the name of the property
      Returns:
      the description for a specific primary model
    • getDescriptionFor

      public final String getDescriptionFor(@NonNull @NonNull BrAPIType type, @NonNull @NonNull BrAPIObjectProperty property)
      Gets the description for a specific primary model
      Parameters:
      type - the primary model
      property - the property
      Returns:
      the description for a specific primary model
    • getSummaryFor

      public final String getSummaryFor(@NonNull @NonNull String typeName, @NonNull @NonNull String propertyName)
      Gets the summary for a specific primary model
      Parameters:
      typeName - the name of the primary model
      propertyName - the name of the property
      Returns:
      the summary for a specific primary model
    • getSummaryFor

      public final String getSummaryFor(@NonNull @NonNull BrAPIType type, @NonNull @NonNull BrAPIObjectProperty property)
      Gets the summary for a specific primary model
      Parameters:
      type - the primary model
      Returns:
      the summary for a specific primary model