Package org.eclipse.microprofile.openapi
Class OASFactory
- java.lang.Object
-
- org.eclipse.microprofile.openapi.OASFactory
-
public final class OASFactory extends java.lang.Object
This class allows application developers to build new OpenAPI model elements.
For example, to start a new top-level OpenAPI element with an ExternalDocument inside of it an application developer would write:OASFactory.createObject(OpenAPI.class) .setExternalDocs(OASFactory.createObject(ExternalDocumentation.class).url("http://myDoc"));
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends Constructible>
TcreateObject(java.lang.Class<T> clazz)
This method creates a new instance of a constructible element from the OpenAPI model tree.
-
-
-
Method Detail
-
createObject
public static <T extends Constructible> T createObject(java.lang.Class<T> clazz)
This method creates a new instance of a constructible element from the OpenAPI model tree.
Example:OASFactory.createObject(Info.class).title("Airlines").description("Airlines APIs").version("1.0.0");
- Type Parameters:
T
- describes the type parameter- Parameters:
clazz
- represents a model which extends theConstructible
interface- Returns:
- a new instance of the requested model class
- Throws:
java.lang.NullPointerException
- if the specified class is nulljava.lang.IllegalArgumentException
- if an instance could not be created, most likely, due to an illegal or inappropriate class
-
-