org.openapijsonschematools.client.components.schemas.PublicKey.java
public class PublicKey
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 | PublicKey.PublicKey1Boxed sealed interface for validated payloads |
record | PublicKey.PublicKey1BoxedMap boxed class to store validated Map payloads |
static class | PublicKey.PublicKey1 schema class |
static class | PublicKey.PublicKeyMapBuilder builder for Map payloads |
static class | PublicKey.PublicKeyMap output class for Map payloads |
sealed interface | PublicKey.KeyBoxed sealed interface for validated payloads |
record | PublicKey.KeyBoxedString boxed class to store validated String payloads |
static class | PublicKey.Key schema class |
public sealed interface PublicKey1Boxed
permits
PublicKey1BoxedMap
sealed interface that stores validated payloads using boxed classes
public record PublicKey1BoxedMap
implements PublicKey1Boxed
record that stores validated Map payloads, sealed permits implementation
Constructor and Description |
---|
PublicKey1BoxedMap(PublicKeyMap data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
PublicKeyMap | data() validated payload |
@Nullable Object | getData() validated payload |
public static class PublicKey1
extends JsonSchema
A schema class that validates payloads
schema that contains a property named key
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.PublicKey;
import java.util.Arrays;
import java.util.List;
import java.util.AbstractMap;
static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build());
// Map validation
PublicKey.PublicKeyMap validatedPayload =
PublicKey.PublicKey1.validate(
new PublicKey.PublicKeyMapBuilder()
.key("a")
.build(),
configuration
);
Modifier and Type | Field and Description |
---|---|
Set<Class<?>> | type = Set.of(Map.class) |
Map<String, Class<? extends JsonSchema>> | properties = Map.ofEntries( new PropertyEntry("key", Key.class)) ) |
Modifier and Type | Method and Description |
---|---|
PublicKeyMap | validate(Map<?, ?> arg, SchemaConfiguration configuration) |
PublicKey1BoxedMap | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) |
PublicKey1Boxed | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) |
@Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) |
public class PublicKeyMapBuilder
builder for Map<String, @Nullable Object>
A class that builds the Map input type
Constructor and Description |
---|
PublicKeyMapBuilder() Creates a builder that contains an empty map |
Modifier and Type | Method and Description |
---|---|
Map<String, @Nullable Object> | build() Returns map input that should be used with Schema.validate |
PublicKeyMapBuilder | key(String value) |
PublicKeyMapBuilder | additionalProperty(String key, Void value) |
PublicKeyMapBuilder | additionalProperty(String key, boolean value) |
PublicKeyMapBuilder | additionalProperty(String key, String value) |
PublicKeyMapBuilder | additionalProperty(String key, int value) |
PublicKeyMapBuilder | additionalProperty(String key, float value) |
PublicKeyMapBuilder | additionalProperty(String key, long value) |
PublicKeyMapBuilder | additionalProperty(String key, double value) |
PublicKeyMapBuilder | additionalProperty(String key, List<?> value) |
PublicKeyMapBuilder | additionalProperty(String key, Map<String, ?> value) |
public static class PublicKeyMap
extends FrozenMap<String, @Nullable Object>
A class to store validated Map payloads
Modifier and Type | Method and Description |
---|---|
static PublicKeyMap | of(Map<String, ? extends @Nullable Object> arg, SchemaConfiguration configuration) |
String | key() [optional] |
@Nullable Object | getAdditionalProperty(String name) provides type safety for additional properties |
public sealed interface KeyBoxed
permits
KeyBoxedString
sealed interface that stores validated payloads using boxed classes
public record KeyBoxedString
implements KeyBoxed
record that stores validated String payloads, sealed permits implementation
Constructor and Description |
---|
KeyBoxedString(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 Key
extends StringJsonSchema.StringJsonSchema1
A schema class that validates payloads
Methods Inherited from class org.openapijsonschematools.client.schemas.StringJsonSchema.StringJsonSchema1 |
---|
validate |
validateAndBox |