github.com/phrase/openapi@v0.0.0-20240514140800-49e8a106740e/openapi-generator/templates/java/libraries/jersey2-experimental/AbstractOpenApiSchema.mustache (about)

     1  {{>licenseInfo}}
     2  
     3  package {{invokerPackage}}.model;
     4  
     5  import org.openapitools.client.ApiException;
     6  import java.lang.reflect.Type;
     7  import java.util.Map;
     8  import javax.ws.rs.core.GenericType;
     9  
    10  /**
    11   * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec
    12   */
    13  {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}
    14  public abstract class AbstractOpenApiSchema {
    15  
    16      // store the actual instance of the schema/object
    17      private Object instance;
    18  
    19      // schema type (e.g. oneOf, anyOf)
    20      private final String schemaType;
    21  
    22      public AbstractOpenApiSchema(String schemaType) {
    23          this.schemaType = schemaType;
    24      }
    25  
    26      /***
    27       * Get the list of schemas allowed to be stored in this object
    28       *
    29       * @return an instance of the actual schema/object
    30       */
    31      public abstract Map<String, GenericType> getSchemas();
    32  
    33      /***
    34       * Get the actual instance
    35       *
    36       * @return an instance of the actual schema/object
    37       */
    38      public Object getActualInstance() {return instance;}
    39  
    40      /***
    41       * Set the actual instance
    42       *
    43       * @param instance the actual instance of the schema/object
    44       */
    45      public void setActualInstance(Object instance) {this.instance = instance;}
    46  
    47      /***
    48       * Get the schema type (e.g. anyOf, oneOf)
    49       *
    50       * @return the schema type
    51       */
    52      public String getSchemaType() {
    53          return schemaType;
    54      }
    55  }