Package io.muserver.openapi
Class ExampleObjectBuilder
- java.lang.Object
-
- io.muserver.openapi.ExampleObjectBuilder
-
public class ExampleObjectBuilder extends java.lang.Object
A builder forExampleObject
objects
-
-
Constructor Summary
Constructors Constructor Description ExampleObjectBuilder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ExampleObject
build()
static ExampleObjectBuilder
exampleObject()
Creates a builder for anExampleObject
ExampleObjectBuilder
withDescription(java.lang.String description)
ExampleObjectBuilder
withExternalValue(java.net.URI externalValue)
ExampleObjectBuilder
withSummary(java.lang.String summary)
ExampleObjectBuilder
withValue(java.lang.Object value)
-
-
-
Method Detail
-
withSummary
public ExampleObjectBuilder withSummary(java.lang.String summary)
- Parameters:
summary
- Short description for the example.- Returns:
- The current builder
-
withDescription
public ExampleObjectBuilder withDescription(java.lang.String description)
- Parameters:
description
- Long description for the example. CommonMark syntax MAY be used for rich text representation.- Returns:
- The current builder
-
withValue
public ExampleObjectBuilder withValue(java.lang.Object value)
- Parameters:
value
- Embedded literal example. Thevalue
field andexternalValue
field are mutually exclusive. To represent examples of media types that cannot naturally represented in JSON or YAML, use a string value to contain the example, escaping where necessary.- Returns:
- The current builder
-
withExternalValue
public ExampleObjectBuilder withExternalValue(java.net.URI externalValue)
- Parameters:
externalValue
- A URL that points to the literal example. This provides the capability to reference examples that cannot easily be included in JSON or YAML documents. Thevalue
field andexternalValue
field are mutually exclusive.- Returns:
- The current builder
-
build
public ExampleObject build()
- Returns:
- A new object
-
exampleObject
public static ExampleObjectBuilder exampleObject()
Creates a builder for anExampleObject
- Returns:
- A new builder
-
-