Class Schema.Builder
-
- All Implemented Interfaces:
public abstract class Schema.BuilderBuilder for Schema.
-
-
Constructor Summary
Constructors Constructor Description Schema.Builder()
-
Method Summary
Modifier and Type Method Description abstract Schema.BuilderanyOf(List<Schema> anyOf)Setter for anyOf. Schema.BuilderanyOf(Array<Schema> anyOf)Setter for anyOf. Schema.BuilderanyOf(Array<Schema.Builder> anyOfBuilders)Setter for anyOf builder. Schema.BuilderclearAnyOf()Clears the value of anyOf field. abstract Schema.Builderdefault_(Object default_)Setter for default_. Schema.BuilderclearDefault_()Clears the value of default_ field. abstract Schema.Builderdescription(String description)Setter for description. Schema.BuilderclearDescription()Clears the value of description field. abstract Schema.Builderenum_(List<String> enum_)Setter for enum_. Schema.Builderenum_(Array<String> enum_)Setter for enum_. Schema.BuilderclearEnum_()Clears the value of enum_ field. abstract Schema.Builderexample(Object example)Setter for example. Schema.BuilderclearExample()Clears the value of example field. abstract Schema.Builderformat(String format)Setter for format. Schema.BuilderclearFormat()Clears the value of format field. abstract Schema.Builderitems(Schema items)Setter for items. Schema.Builderitems(Schema.Builder itemsBuilder)Setter for items builder. Schema.BuilderclearItems()Clears the value of items field. abstract Schema.BuildermaxItems(Long maxItems)Setter for maxItems. Schema.BuilderclearMaxItems()Clears the value of maxItems field. abstract Schema.BuildermaxLength(Long maxLength)Setter for maxLength. Schema.BuilderclearMaxLength()Clears the value of maxLength field. abstract Schema.BuildermaxProperties(Long maxProperties)Setter for maxProperties. Schema.BuilderclearMaxProperties()Clears the value of maxProperties field. abstract Schema.Buildermaximum(Double maximum)Setter for maximum. Schema.BuilderclearMaximum()Clears the value of maximum field. abstract Schema.BuilderminItems(Long minItems)Setter for minItems. Schema.BuilderclearMinItems()Clears the value of minItems field. abstract Schema.BuilderminLength(Long minLength)Setter for minLength. Schema.BuilderclearMinLength()Clears the value of minLength field. abstract Schema.BuilderminProperties(Long minProperties)Setter for minProperties. Schema.BuilderclearMinProperties()Clears the value of minProperties field. abstract Schema.Builderminimum(Double minimum)Setter for minimum. Schema.BuilderclearMinimum()Clears the value of minimum field. abstract Schema.Buildernullable(boolean nullable)Setter for nullable. Schema.BuilderclearNullable()Clears the value of nullable field. abstract Schema.Builderpattern(String pattern)Setter for pattern. Schema.BuilderclearPattern()Clears the value of pattern field. abstract Schema.Builderproperties(Map<String, Schema> properties)Setter for properties. Schema.BuilderclearProperties()Clears the value of properties field. abstract Schema.BuilderpropertyOrdering(List<String> propertyOrdering)Setter for propertyOrdering. Schema.BuilderpropertyOrdering(Array<String> propertyOrdering)Setter for propertyOrdering. Schema.BuilderclearPropertyOrdering()Clears the value of propertyOrdering field. abstract Schema.Builderrequired(List<String> required)Setter for required. Schema.Builderrequired(Array<String> required)Setter for required. Schema.BuilderclearRequired()Clears the value of required field. abstract Schema.Buildertitle(String title)Setter for title. Schema.BuilderclearTitle()Clears the value of title field. abstract Schema.Buildertype(Type type)Setter for type. Schema.BuilderclearType()Clears the value of type field. Schema.Buildertype(Type.Known knownType)Setter for type given a known enum. Schema.Buildertype(String type)Setter for type given a string. abstract Schemabuild()-
-
Method Detail
-
anyOf
abstract Schema.Builder anyOf(List<Schema> anyOf)
Setter for anyOf.
anyOf: Optional. The instance must be valid against any (one or more) of the subschemas listed in `any_of`.
-
anyOf
@CanIgnoreReturnValue() Schema.Builder anyOf(Array<Schema> anyOf)
Setter for anyOf.
anyOf: Optional. The instance must be valid against any (one or more) of the subschemas listed in `any_of`.
-
anyOf
@CanIgnoreReturnValue() Schema.Builder anyOf(Array<Schema.Builder> anyOfBuilders)
Setter for anyOf builder.
anyOf: Optional. The instance must be valid against any (one or more) of the subschemas listed in `any_of`.
-
clearAnyOf
@CanIgnoreReturnValue() Schema.Builder clearAnyOf()
Clears the value of anyOf field.
-
default_
abstract Schema.Builder default_(Object default_)
Setter for default_.
default_: Optional. Default value to use if the field is not specified.
-
clearDefault_
@CanIgnoreReturnValue() Schema.Builder clearDefault_()
Clears the value of default_ field.
-
description
abstract Schema.Builder description(String description)
Setter for description.
description: Optional. Describes the data. The model uses this field to understand the purpose of the schema and how to use it. It is a best practice to provide a clear and descriptive explanation for the schema and its properties here, rather than in the prompt.
-
clearDescription
@CanIgnoreReturnValue() Schema.Builder clearDescription()
Clears the value of description field.
-
enum_
abstract Schema.Builder enum_(List<String> enum_)
Setter for enum_.
enum_: Optional. Possible values of the field. This field can be used to restrict a value to a fixed set of values. To mark a field as an enum, set `format` to `enum` and provide the list of possible values in `enum`. For example: 1. To define directions: `{type:STRING, format:enum, enum:["EAST", "NORTH", "SOUTH", "WEST"]}` 2. To define apartment numbers: `{type:INTEGER, format:enum, enum:["101", "201", "301"]}`
-
enum_
@CanIgnoreReturnValue() Schema.Builder enum_(Array<String> enum_)
Setter for enum_.
enum_: Optional. Possible values of the field. This field can be used to restrict a value to a fixed set of values. To mark a field as an enum, set `format` to `enum` and provide the list of possible values in `enum`. For example: 1. To define directions: `{type:STRING, format:enum, enum:["EAST", "NORTH", "SOUTH", "WEST"]}` 2. To define apartment numbers: `{type:INTEGER, format:enum, enum:["101", "201", "301"]}`
-
clearEnum_
@CanIgnoreReturnValue() Schema.Builder clearEnum_()
Clears the value of enum_ field.
-
example
abstract Schema.Builder example(Object example)
Setter for example.
example: Optional. Example of an instance of this schema.
-
clearExample
@CanIgnoreReturnValue() Schema.Builder clearExample()
Clears the value of example field.
-
format
abstract Schema.Builder format(String format)
Setter for format.
format: Optional. The format of the data. For `NUMBER` type, format can be `float` or `double`. For `INTEGER` type, format can be `int32` or `int64`. For `STRING` type, format can be `email`, `byte`, `date`, `date-time`, `password`, and other formats to further refine the data type.
-
clearFormat
@CanIgnoreReturnValue() Schema.Builder clearFormat()
Clears the value of format field.
-
items
abstract Schema.Builder items(Schema items)
Setter for items.
items: Optional. If type is `ARRAY`, `items` specifies the schema of elements in the array.
-
items
@CanIgnoreReturnValue() Schema.Builder items(Schema.Builder itemsBuilder)
Setter for items builder.
items: Optional. If type is `ARRAY`, `items` specifies the schema of elements in the array.
-
clearItems
@CanIgnoreReturnValue() Schema.Builder clearItems()
Clears the value of items field.
-
maxItems
abstract Schema.Builder maxItems(Long maxItems)
Setter for maxItems.
maxItems: Optional. If type is `ARRAY`, `max_items` specifies the maximum number of items in an array.
-
clearMaxItems
@CanIgnoreReturnValue() Schema.Builder clearMaxItems()
Clears the value of maxItems field.
-
maxLength
abstract Schema.Builder maxLength(Long maxLength)
Setter for maxLength.
maxLength: Optional. If type is `STRING`, `max_length` specifies the maximum length of the string.
-
clearMaxLength
@CanIgnoreReturnValue() Schema.Builder clearMaxLength()
Clears the value of maxLength field.
-
maxProperties
abstract Schema.Builder maxProperties(Long maxProperties)
Setter for maxProperties.
maxProperties: Optional. If type is `OBJECT`, `max_properties` specifies the maximum number of properties that can be provided.
-
clearMaxProperties
@CanIgnoreReturnValue() Schema.Builder clearMaxProperties()
Clears the value of maxProperties field.
-
maximum
abstract Schema.Builder maximum(Double maximum)
Setter for maximum.
maximum: Optional. If type is `INTEGER` or `NUMBER`, `maximum` specifies the maximum allowed value.
-
clearMaximum
@CanIgnoreReturnValue() Schema.Builder clearMaximum()
Clears the value of maximum field.
-
minItems
abstract Schema.Builder minItems(Long minItems)
Setter for minItems.
minItems: Optional. If type is `ARRAY`, `min_items` specifies the minimum number of items in an array.
-
clearMinItems
@CanIgnoreReturnValue() Schema.Builder clearMinItems()
Clears the value of minItems field.
-
minLength
abstract Schema.Builder minLength(Long minLength)
Setter for minLength.
minLength: Optional. If type is `STRING`, `min_length` specifies the minimum length of the string.
-
clearMinLength
@CanIgnoreReturnValue() Schema.Builder clearMinLength()
Clears the value of minLength field.
-
minProperties
abstract Schema.Builder minProperties(Long minProperties)
Setter for minProperties.
minProperties: Optional. If type is `OBJECT`, `min_properties` specifies the minimum number of properties that can be provided.
-
clearMinProperties
@CanIgnoreReturnValue() Schema.Builder clearMinProperties()
Clears the value of minProperties field.
-
minimum
abstract Schema.Builder minimum(Double minimum)
Setter for minimum.
minimum: Optional. If type is `INTEGER` or `NUMBER`, `minimum` specifies the minimum allowed value.
-
clearMinimum
@CanIgnoreReturnValue() Schema.Builder clearMinimum()
Clears the value of minimum field.
-
nullable
abstract Schema.Builder nullable(boolean nullable)
Setter for nullable.
nullable: Optional. Indicates if the value of this field can be null.
-
clearNullable
@CanIgnoreReturnValue() Schema.Builder clearNullable()
Clears the value of nullable field.
-
pattern
abstract Schema.Builder pattern(String pattern)
Setter for pattern.
pattern: Optional. If type is `STRING`, `pattern` specifies a regular expression that the string must match.
-
clearPattern
@CanIgnoreReturnValue() Schema.Builder clearPattern()
Clears the value of pattern field.
-
properties
abstract Schema.Builder properties(Map<String, Schema> properties)
Setter for properties.
properties: Optional. If type is `OBJECT`, `properties` is a map of property names to schema definitions for each property of the object.
-
clearProperties
@CanIgnoreReturnValue() Schema.Builder clearProperties()
Clears the value of properties field.
-
propertyOrdering
abstract Schema.Builder propertyOrdering(List<String> propertyOrdering)
Setter for propertyOrdering.
propertyOrdering: Optional. Order of properties displayed or used where order matters. This is not a standard field in OpenAPI specification, but can be used to control the order of properties.
-
propertyOrdering
@CanIgnoreReturnValue() Schema.Builder propertyOrdering(Array<String> propertyOrdering)
Setter for propertyOrdering.
propertyOrdering: Optional. Order of properties displayed or used where order matters. This is not a standard field in OpenAPI specification, but can be used to control the order of properties.
-
clearPropertyOrdering
@CanIgnoreReturnValue() Schema.Builder clearPropertyOrdering()
Clears the value of propertyOrdering field.
-
required
abstract Schema.Builder required(List<String> required)
Setter for required.
required: Optional. If type is `OBJECT`, `required` lists the names of properties that must be present.
-
required
@CanIgnoreReturnValue() Schema.Builder required(Array<String> required)
Setter for required.
required: Optional. If type is `OBJECT`, `required` lists the names of properties that must be present.
-
clearRequired
@CanIgnoreReturnValue() Schema.Builder clearRequired()
Clears the value of required field.
-
title
abstract Schema.Builder title(String title)
Setter for title.
title: Optional. Title for the schema.
-
clearTitle
@CanIgnoreReturnValue() Schema.Builder clearTitle()
Clears the value of title field.
-
type
abstract Schema.Builder type(Type type)
Setter for type.
type: Optional. Data type of the schema field.
-
clearType
@CanIgnoreReturnValue() Schema.Builder clearType()
Clears the value of type field.
-
type
@CanIgnoreReturnValue() Schema.Builder type(Type.Known knownType)
Setter for type given a known enum.
type: Optional. Data type of the schema field.
-
type
@CanIgnoreReturnValue() Schema.Builder type(String type)
Setter for type given a string.
type: Optional. Data type of the schema field.
-
-
-
-