Class AbstractGeneratorSubOptions

java.lang.Object
org.brapi.schematools.core.options.AbstractGeneratorSubOptions
All Implemented Interfaces:
Options, Validatable
Direct Known Subclasses:
AbstractGraphQLOptions, AbstractOpenAPIOptions

public abstract class AbstractGeneratorSubOptions extends Object implements Options
Provides general options for all sub-options in generators
  • Constructor Details

    • AbstractGeneratorSubOptions

      public AbstractGeneratorSubOptions()
  • 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(AbstractGeneratorSubOptions 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 name)
      Determines if the Endpoint/Query/Mutation is generated for a specific primary model
      Parameters:
      name - the name of the primary model
      Returns:
      true if the Endpoint/Query/Mutation is generated for a specific primary model, false otherwise
    • isGeneratingFor

      public final boolean isGeneratingFor(@NonNull @NonNull BrAPIType type)
      Determines if the Endpoint/Query/Mutation is generated for a specific primary model
      Parameters:
      type - the primary model
      Returns:
      true if the Endpoint/Query/Mutation is generated for a specific primary model, false otherwise
    • setGenerateFor

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

      public AbstractGeneratorSubOptions setGenerateFor(BrAPIType type, boolean generate)
      Sets if the Endpoint/Query/Mutation is generated for a specific primary model.
      Parameters:
      type - the primary model
      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 name)
      Gets the description for a specific primary model
      Parameters:
      name - the name of the primary model
      Returns:
      the description for a specific primary model
    • getDescriptionFor

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