Class AbstractOpenAPIMetadata

java.lang.Object
org.brapi.schematools.core.openapi.generator.metadata.AbstractOpenAPIMetadata
All Implemented Interfaces:
Metadata, Validatable
Direct Known Subclasses:
DeleteMetadata, ListGetMetadata, PostMetadata, PutMetadata, SearchMetadata, SingleGetMetadata

public class AbstractOpenAPIMetadata extends Object implements Metadata
Base class for OpenAPI metadata
  • Constructor Details

    • AbstractOpenAPIMetadata

      public AbstractOpenAPIMetadata()
  • Method Details

    • override

      public void override(AbstractOpenAPIMetadata overrideMetadata)
      Overrides the values in this Options Object from the provided Options Object if they are non-null
      Parameters:
      overrideMetadata - the options which will be used to override this Options Object
    • getSummaryOrDefault

      public final String getSummaryOrDefault(@NonNull @NonNull String name, String defaultValue)
      Gets the summary for a specific primary model
      Parameters:
      name - the name of the primary model
      defaultValue - default value used if model is not found in map summaries
      Returns:
      the summary for a specific primary model
    • getSummaryOrDefault

      public final String getSummaryOrDefault(@NonNull @NonNull BrAPIType type, String defaultValue)
      Gets the summary for a specific primary model
      Parameters:
      type - the primary model
      defaultValue - default value used if model is not found in map summaries
      Returns:
      the summary for a specific primary model
    • setSummaryFor

      public AbstractOpenAPIMetadata setSummaryFor(String name, String description)
      Sets the summary for a specific primary model.
      Parameters:
      name - the name of the primary model
      description - the summary for a specific primary model.
      Returns:
      the options for chaining
    • getDescriptionOrDefault

      public final String getDescriptionOrDefault(@NonNull @NonNull String name, String defaultValue)
      Gets the description for a specific primary model
      Parameters:
      name - the name of the primary model
      defaultValue - default value used if model is not found in map descriptions
      Returns:
      the description for a specific primary model
    • getDescriptionOrDefault

      public final String getDescriptionOrDefault(@NonNull @NonNull BrAPIType type, String defaultValue)
      Gets the description for a specific primary model
      Parameters:
      type - the primary model
      defaultValue - default value used if model is not found in map descriptions
      Returns:
      the description for a specific primary model
    • setDescriptionFor

      public AbstractOpenAPIMetadata setDescriptionFor(String name, String description)
      Sets the description for a specific primary model.
      Parameters:
      name - the name of the primary model
      description - the description for a specific primary model.
      Returns:
      the options for chaining