org.openapijsonschematools.client.components.schemas.ComposedArray.java
public class ComposedArray
A class that contains necessary nested
- schema classes (which validate payloads), extends JsonSchema
- sealed interfaces which store validated payloads, java version of a sum type
- boxed classes which store validated payloads, sealed permits class implementations
- classes to store validated list payloads, extends FrozenList
- classes to build inputs for list payloads
Modifier and Type | Class and Description |
---|---|
sealed interface | ComposedArray.ComposedArray1Boxed sealed interface for validated payloads |
record | ComposedArray.ComposedArray1BoxedList boxed class to store validated List payloads |
static class | ComposedArray.ComposedArray1 schema class |
static class | ComposedArray.ComposedArrayListBuilder builder for List payloads |
static class | ComposedArray.ComposedArrayList output class for List payloads |
sealed interface | ComposedArray.ItemsBoxed sealed interface for validated payloads |
record | ComposedArray.ItemsBoxedVoid boxed class to store validated null payloads |
record | ComposedArray.ItemsBoxedBoolean boxed class to store validated boolean payloads |
record | ComposedArray.ItemsBoxedNumber boxed class to store validated Number payloads |
record | ComposedArray.ItemsBoxedString boxed class to store validated String payloads |
record | ComposedArray.ItemsBoxedList boxed class to store validated List payloads |
record | ComposedArray.ItemsBoxedMap boxed class to store validated Map payloads |
static class | ComposedArray.Items schema class |
public sealed interface ComposedArray1Boxed
permits
ComposedArray1BoxedList
sealed interface that stores validated payloads using boxed classes
public record ComposedArray1BoxedList
implements ComposedArray1Boxed
record that stores validated List payloads, sealed permits implementation
Constructor and Description |
---|
ComposedArray1BoxedList(ComposedArrayList data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
ComposedArrayList | data() validated payload |
@Nullable Object | getData() validated payload |
public static class ComposedArray1
extends JsonSchema
A schema class that validates payloads
import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags;
import org.openapijsonschematools.client.configurations.SchemaConfiguration;
import org.openapijsonschematools.client.exceptions.ValidationException;
import org.openapijsonschematools.client.schemas.validation.MapUtils;
import org.openapijsonschematools.client.schemas.validation.FrozenList;
import org.openapijsonschematools.client.schemas.validation.FrozenMap;
import org.openapijsonschematools.client.components.schemas.ComposedArray;
import java.util.Arrays;
import java.util.List;
import java.util.AbstractMap;
static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build());
// List validation
ComposedArray.ComposedArrayList validatedPayload =
ComposedArray.ComposedArray1.validate(
new ComposedArray.ComposedArrayListBuilder()
.build(),
configuration
);
Modifier and Type | Field and Description |
---|---|
Set<Class<?>> | type = Set.of(List.class) |
Class<? extends JsonSchema> | items = Items.class |
Modifier and Type | Method and Description |
---|---|
ComposedArrayList | validate(List<?> arg, SchemaConfiguration configuration) |
ComposedArray1BoxedList | validateAndBox(List<?> arg, SchemaConfiguration configuration) |
ComposedArray1Boxed | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) |
@Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) |
public class ComposedArrayListBuilder
builder for List<@Nullable Object>
A class that builds the List input type
Constructor and Description |
---|
ComposedArrayListBuilder() Creates an empty list |
ComposedArrayListBuilder(List<@Nullable Object> items) Stores the items in a list |
Modifier and Type | Method and Description |
---|---|
ComposedArrayListBuilder | add(Void item) |
ComposedArrayListBuilder | add(boolean item) |
ComposedArrayListBuilder | add(String item) |
ComposedArrayListBuilder | add(int item) |
ComposedArrayListBuilder | add(float item) |
ComposedArrayListBuilder | add(long item) |
ComposedArrayListBuilder | add(double item) |
ComposedArrayListBuilder | add(List<?> item) |
ComposedArrayListBuilder | add(Map<String, ?> item) |
List<@Nullable Object> | build() Returns list input that should be used with Schema.validate |
public class ComposedArrayList
extends FrozenList<@Nullable Object>
A class to store validated List payloads
Modifier and Type | Method and Description |
---|---|
static ComposedArrayList | of(List<? extends @Nullable Object> arg, SchemaConfiguration configuration) |
public sealed interface ItemsBoxed
permits
ItemsBoxedVoid,
ItemsBoxedBoolean,
ItemsBoxedNumber,
ItemsBoxedString,
ItemsBoxedList,
ItemsBoxedMap
sealed interface that stores validated payloads using boxed classes
public record ItemsBoxedVoid
implements ItemsBoxed
record that stores validated null payloads, sealed permits implementation
Constructor and Description |
---|
ItemsBoxedVoid(Void data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
Void | data() validated payload |
@Nullable Object | getData() validated payload |
public record ItemsBoxedBoolean
implements ItemsBoxed
record that stores validated boolean payloads, sealed permits implementation
Constructor and Description |
---|
ItemsBoxedBoolean(boolean data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
boolean | data() validated payload |
@Nullable Object | getData() validated payload |
public record ItemsBoxedNumber
implements ItemsBoxed
record that stores validated Number payloads, sealed permits implementation
Constructor and Description |
---|
ItemsBoxedNumber(Number data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
Number | data() validated payload |
@Nullable Object | getData() validated payload |
public record ItemsBoxedString
implements ItemsBoxed
record that stores validated String payloads, sealed permits implementation
Constructor and Description |
---|
ItemsBoxedString(String data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
String | data() validated payload |
@Nullable Object | getData() validated payload |
public record ItemsBoxedList
implements ItemsBoxed
record that stores validated List payloads, sealed permits implementation
Constructor and Description |
---|
ItemsBoxedList(FrozenList<@Nullable Object> data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
FrozenList<@Nullable Object> | data() validated payload |
@Nullable Object | getData() validated payload |
public record ItemsBoxedMap
implements ItemsBoxed
record that stores validated Map payloads, sealed permits implementation
Constructor and Description |
---|
ItemsBoxedMap(FrozenMap<@Nullable Object> data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
FrozenMap<@Nullable Object> | data() validated payload |
@Nullable Object | getData() validated payload |
public static class Items
extends AnyTypeJsonSchema.AnyTypeJsonSchema1
A schema class that validates payloads
Methods Inherited from class org.openapijsonschematools.client.schemas.AnyTypeJsonSchema.AnyTypeJsonSchema1 |
---|
validate |
validateAndBox |