Class ProblemOrError

    • Field Detail

      • schemas

        public static final Map<String,​javax.ws.rs.core.GenericType> schemas
    • Constructor Detail

      • ProblemOrError

        public ProblemOrError()
      • ProblemOrError

        public ProblemOrError​(Error o)
      • ProblemOrError

        public ProblemOrError​(Problem o)
    • Method Detail

      • getSchemas

        public Map<String,​javax.ws.rs.core.GenericType> getSchemas()
        Description copied from class: AbstractOpenApiSchema
        Get the list of oneOf/anyOf composed schemas allowed to be stored in this object
        Specified by:
        getSchemas in class AbstractOpenApiSchema
        Returns:
        an instance of the actual schema/object
      • setActualInstance

        public void setActualInstance​(Object instance)
        Set the instance that matches the oneOf child schema, check the instance parameter is valid against the oneOf child schemas: Error, Problem It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf).
        Overrides:
        setActualInstance in class AbstractOpenApiSchema
        Parameters:
        instance - the actual instance of the schema/object
      • getActualInstance

        public Object getActualInstance()
        Get the actual instance, which can be the following: Error, Problem
        Overrides:
        getActualInstance in class AbstractOpenApiSchema
        Returns:
        The actual instance (Error, Problem)
      • getError

        public Error getError()
                       throws ClassCastException
        Get the actual instance of `Error`. If the actual instance is not `Error`, the ClassCastException will be thrown.
        Returns:
        The actual instance of `Error`
        Throws:
        ClassCastException - if the instance is not `Error`
      • getProblem

        public Problem getProblem()
                           throws ClassCastException
        Get the actual instance of `Problem`. If the actual instance is not `Problem`, the ClassCastException will be thrown.
        Returns:
        The actual instance of `Problem`
        Throws:
        ClassCastException - if the instance is not `Problem`
      • validateJsonObject

        public static void validateJsonObject​(com.google.gson.JsonObject jsonObj)
                                       throws IOException
        Validates the JSON Object and throws an exception if issues found
        Parameters:
        jsonObj - JSON Object
        Throws:
        IOException - if the JSON Object is invalid with respect to ProblemOrError
      • fromJson

        public static ProblemOrError fromJson​(String jsonString)
                                       throws IOException
        Create an instance of ProblemOrError given an JSON string
        Parameters:
        jsonString - JSON string
        Returns:
        An instance of ProblemOrError
        Throws:
        IOException - if the JSON string is invalid with respect to ProblemOrError
      • toJson

        public String toJson()
        Convert an instance of ProblemOrError to an JSON string
        Returns:
        JSON string