org.openapijsonschematools.client.components.schemas.Apple.java
public class Apple
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 map payloads, extends FrozenMap
- classes to build inputs for map payloads
Modifier and Type | Class and Description |
---|---|
sealed interface | Apple.Apple1Boxed sealed interface for validated payloads |
record | Apple.Apple1BoxedVoid boxed class to store validated null payloads |
record | Apple.Apple1BoxedMap boxed class to store validated Map payloads |
static class | Apple.Apple1 schema class |
static class | Apple.AppleMapBuilder builder for Map payloads |
static class | Apple.AppleMap output class for Map payloads |
sealed interface | Apple.OriginBoxed sealed interface for validated payloads |
record | Apple.OriginBoxedString boxed class to store validated String payloads |
static class | Apple.Origin schema class |
sealed interface | Apple.CultivarBoxed sealed interface for validated payloads |
record | Apple.CultivarBoxedString boxed class to store validated String payloads |
static class | Apple.Cultivar schema class |
public sealed interface Apple1Boxed
permits
Apple1BoxedVoid,
Apple1BoxedMap
sealed interface that stores validated payloads using boxed classes
public record Apple1BoxedVoid
implements Apple1Boxed
record that stores validated null payloads, sealed permits implementation
Constructor and Description |
---|
Apple1BoxedVoid(Void data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
Void | data() validated payload |
@Nullable Object | getData() validated payload |
public record Apple1BoxedMap
implements Apple1Boxed
record that stores validated Map payloads, sealed permits implementation
Constructor and Description |
---|
Apple1BoxedMap(AppleMap data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
AppleMap | data() validated payload |
@Nullable Object | getData() validated payload |
public static class Apple1
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.Apple;
import java.util.Arrays;
import java.util.List;
import java.util.AbstractMap;
static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build());
// null validation
Void validatedPayload = Apple.Apple1.validate(
(Void) null,
configuration
);
// Map validation
Apple.AppleMap validatedPayload =
Apple.Apple1.validate(
new Apple.AppleMapBuilder()
.cultivar("IaQn�EaqioxT oASzjxaSH")
.origin("IaQn�EaqioxT oASzjxaSH")
.build(),
configuration
);
Modifier and Type | Field and Description |
---|---|
Set<Class<?>> | type = Set.of( Void.class, Map.class ) |
Map<String, Class<? extends JsonSchema>> | properties = Map.ofEntries( new PropertyEntry("cultivar", Cultivar.class)), new PropertyEntry("origin", Origin.class)) ) |
Set | required = Set.of( "cultivar" ) |
Modifier and Type | Method and Description |
---|---|
Void | validate(Void arg, SchemaConfiguration configuration) |
Apple1BoxedVoid | validateAndBox(Void arg, SchemaConfiguration configuration) |
AppleMap | validate(Map<?, ?> arg, SchemaConfiguration configuration) |
Apple1BoxedMap | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) |
Apple1Boxed | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) |
@Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) |
public class AppleMap0Builder
builder for Map<String, @Nullable Object>
A class that builds the Map input type
Constructor and Description |
---|
AppleMap0Builder(Map<String, @Nullable Object> instance) Creates a builder that contains the passed instance |
Modifier and Type | Method and Description |
---|---|
Map<String, @Nullable Object> | build() Returns map input that should be used with Schema.validate |
AppleMap0Builder | origin(String value) |
AppleMap0Builder | additionalProperty(String key, Void value) |
AppleMap0Builder | additionalProperty(String key, boolean value) |
AppleMap0Builder | additionalProperty(String key, String value) |
AppleMap0Builder | additionalProperty(String key, int value) |
AppleMap0Builder | additionalProperty(String key, float value) |
AppleMap0Builder | additionalProperty(String key, long value) |
AppleMap0Builder | additionalProperty(String key, double value) |
AppleMap0Builder | additionalProperty(String key, List<?> value) |
AppleMap0Builder | additionalProperty(String key, Map<String, ?> value) |
public class AppleMapBuilder
builder for Map<String, @Nullable Object>
A class that builds the Map input type
Constructor and Description |
---|
AppleMapBuilder() Creates a builder that contains an empty map |
Modifier and Type | Method and Description |
---|---|
AppleMap0Builder | cultivar(String value) |
public static class AppleMap
extends FrozenMap<String, @Nullable Object>
A class to store validated Map payloads
Modifier and Type | Method and Description |
---|---|
static AppleMap | of(Map<String, ? extends @Nullable Object> arg, SchemaConfiguration configuration) |
String | cultivar() |
String | origin() [optional] |
@Nullable Object | getAdditionalProperty(String name) provides type safety for additional properties |
public sealed interface OriginBoxed
permits
OriginBoxedString
sealed interface that stores validated payloads using boxed classes
public record OriginBoxedString
implements OriginBoxed
record that stores validated String payloads, sealed permits implementation
Constructor and Description |
---|
OriginBoxedString(String data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
String | data() validated payload |
@Nullable Object | getData() validated payload |
public static class Origin
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.Apple;
import java.util.Arrays;
import java.util.List;
import java.util.AbstractMap;
static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build());
// String validation
String validatedPayload = Apple.Origin.validate(
"IaQn�EaqioxT oASzjxaSH",
configuration
);
Modifier and Type | Field and Description |
---|---|
Set<Class<?>> | type = Set.of( String.class ) |
Pattern | pattern = Pattern.compile( "^[A-Z\s]*$", Pattern.CASE_INSENSITIVE ) |
Modifier and Type | Method and Description |
---|---|
String | validate(String arg, SchemaConfiguration configuration) |
OriginBoxedString | validateAndBox(String arg, SchemaConfiguration configuration) |
OriginBoxed | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) |
@Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) |
public sealed interface CultivarBoxed
permits
CultivarBoxedString
sealed interface that stores validated payloads using boxed classes
public record CultivarBoxedString
implements CultivarBoxed
record that stores validated String payloads, sealed permits implementation
Constructor and Description |
---|
CultivarBoxedString(String data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
String | data() validated payload |
@Nullable Object | getData() validated payload |
public static class Cultivar
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.Apple;
import java.util.Arrays;
import java.util.List;
import java.util.AbstractMap;
static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build());
// String validation
String validatedPayload = Apple.Cultivar.validate(
"IaQn�EaqioxT oASzjxaSH",
configuration
);
Modifier and Type | Field and Description |
---|---|
Set<Class<?>> | type = Set.of( String.class ) |
Pattern | pattern = Pattern.compile( "^[a-zA-Z\s]*$" ) |
Modifier and Type | Method and Description |
---|---|
String | validate(String arg, SchemaConfiguration configuration) |
CultivarBoxedString | validateAndBox(String arg, SchemaConfiguration configuration) |
CultivarBoxed | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) |
@Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) |