Skip to content

Latest commit

 

History

History
463 lines (365 loc) · 19.8 KB

File metadata and controls

463 lines (365 loc) · 19.8 KB

MultiPropertiesSchema

org.openapijsonschematools.client.components.schemas.MultiPropertiesSchema.java public class MultiPropertiesSchema

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
  • classes to store validated map payloads, extends FrozenMap
  • classes to build inputs for map payloads

Nested Class Summary

Modifier and Type Class and Description
sealed interface MultiPropertiesSchema.MultiPropertiesSchema1Boxed
sealed interface for validated payloads
record MultiPropertiesSchema.MultiPropertiesSchema1BoxedMap
boxed class to store validated Map payloads
static class MultiPropertiesSchema.MultiPropertiesSchema1
schema class
static class MultiPropertiesSchema.MultiPropertiesSchemaMapBuilder
builder for Map payloads
static class MultiPropertiesSchema.MultiPropertiesSchemaMap
output class for Map payloads
sealed interface MultiPropertiesSchema.DataBoxed
sealed interface for validated payloads
record MultiPropertiesSchema.DataBoxedList
boxed class to store validated List payloads
static class MultiPropertiesSchema.Data
schema class
static class MultiPropertiesSchema.DataListBuilder
builder for List payloads
static class MultiPropertiesSchema.DataList
output class for List payloads
sealed interface MultiPropertiesSchema.MessageBoxed
sealed interface for validated payloads
record MultiPropertiesSchema.MessageBoxedString
boxed class to store validated String payloads
static class MultiPropertiesSchema.Message
schema class
sealed interface MultiPropertiesSchema.StatusBoxed
sealed interface for validated payloads
record MultiPropertiesSchema.StatusBoxedNumber
boxed class to store validated Number payloads
static class MultiPropertiesSchema.Status
schema class
sealed interface MultiPropertiesSchema.AdditionalPropertiesBoxed
sealed interface for validated payloads
record MultiPropertiesSchema.AdditionalPropertiesBoxedVoid
boxed class to store validated null payloads
record MultiPropertiesSchema.AdditionalPropertiesBoxedBoolean
boxed class to store validated boolean payloads
record MultiPropertiesSchema.AdditionalPropertiesBoxedNumber
boxed class to store validated Number payloads
record MultiPropertiesSchema.AdditionalPropertiesBoxedString
boxed class to store validated String payloads
record MultiPropertiesSchema.AdditionalPropertiesBoxedList
boxed class to store validated List payloads
record MultiPropertiesSchema.AdditionalPropertiesBoxedMap
boxed class to store validated Map payloads
static class MultiPropertiesSchema.AdditionalProperties
schema class

MultiPropertiesSchema1Boxed

public sealed interface MultiPropertiesSchema1Boxed
permits
MultiPropertiesSchema1BoxedMap

sealed interface that stores validated payloads using boxed classes

MultiPropertiesSchema1BoxedMap

public record MultiPropertiesSchema1BoxedMap
implements MultiPropertiesSchema1Boxed

record that stores validated Map payloads, sealed permits implementation

Constructor Summary

Constructor and Description
MultiPropertiesSchema1BoxedMap(MultiPropertiesSchemaMap data)
Creates an instance, private visibility

Method Summary

Modifier and Type Method and Description
MultiPropertiesSchemaMap data()
validated payload
@Nullable Object getData()
validated payload

MultiPropertiesSchema1

public static class MultiPropertiesSchema1
extends JsonSchema

A schema class that validates payloads

Code Sample

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.MultiPropertiesSchema;

import java.util.Arrays;
import java.util.List;
import java.util.AbstractMap;

static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build());

// Map validation
MultiPropertiesSchema.MultiPropertiesSchemaMap validatedPayload =
    MultiPropertiesSchema.MultiPropertiesSchema1.validate(
    new MultiPropertiesSchema.MultiPropertiesSchemaMapBuilder()
        .status(1)

        .data(
            Arrays.asList(
            )
        )
        .message("a")

    .build(),
    configuration
);

Field Summary

Modifier and Type Field and Description
Set<Class<?>> type = Set.of(Map.class)
Map<String, Class<? extends JsonSchema>> properties = Map.ofEntries(
    new PropertyEntry("status", Status.class)),
    new PropertyEntry("data", Data.class)),
    new PropertyEntry("message", Message.class))
)
Set required = Set.of(
    "status"
)
Class<? extends JsonSchema> additionalProperties = AdditionalProperties.class

Method Summary

Modifier and Type Method and Description
MultiPropertiesSchemaMap validate(Map<?, ?> arg, SchemaConfiguration configuration)
MultiPropertiesSchema1BoxedMap validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration)
MultiPropertiesSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration)
@Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration)

MultiPropertiesSchemaMap0Builder

public class MultiPropertiesSchemaMap0Builder
builder for Map<String, Object>

A class that builds the Map input type

Constructor Summary

Constructor and Description
MultiPropertiesSchemaMap0Builder(Map<String, Object> instance)
Creates a builder that contains the passed instance

Method Summary

Modifier and Type Method and Description
Map<String, Object> build()
Returns map input that should be used with Schema.validate
MultiPropertiesSchemaMap0Builder data(List<Map<String, @Nullable Object>> value)
MultiPropertiesSchemaMap0Builder message(String value)

MultiPropertiesSchemaMapBuilder

public class MultiPropertiesSchemaMapBuilder
builder for Map<String, Object>

A class that builds the Map input type

Constructor Summary

Constructor and Description
MultiPropertiesSchemaMapBuilder()
Creates a builder that contains an empty map

Method Summary

Modifier and Type Method and Description
MultiPropertiesSchemaMap0Builder status(int value)
MultiPropertiesSchemaMap0Builder status(float value)

MultiPropertiesSchemaMap

public static class MultiPropertiesSchemaMap
extends FrozenMap<String, Object>

A class to store validated Map payloads

Method Summary

Modifier and Type Method and Description
static MultiPropertiesSchemaMap of(Map<String, Object> arg, SchemaConfiguration configuration)
Number status()
value must be a 32 bit integer
DataList data()
[optional]
String message()
[optional]

DataBoxed

public sealed interface DataBoxed
permits
DataBoxedList

sealed interface that stores validated payloads using boxed classes

DataBoxedList

public record DataBoxedList
implements DataBoxed

record that stores validated List payloads, sealed permits implementation

Constructor Summary

Constructor and Description
DataBoxedList(DataList data)
Creates an instance, private visibility

Method Summary

Modifier and Type Method and Description
DataList data()
validated payload
@Nullable Object getData()
validated payload

Data

public static class Data
extends JsonSchema

A schema class that validates payloads

Code Sample

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.MultiPropertiesSchema;

import java.util.Arrays;
import java.util.List;
import java.util.AbstractMap;

static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build());

// List validation
MultiPropertiesSchema.DataList validatedPayload =
    MultiPropertiesSchema.Data.validate(
    new MultiPropertiesSchema.DataListBuilder()
    .build(),
    configuration
);

Field Summary

Modifier and Type Field and Description
Set<Class<?>> type = Set.of(List.class)
Class<? extends JsonSchema> items = ItemsSchema.ItemsSchema1.class

Method Summary

Modifier and Type Method and Description
DataList validate(List<?> arg, SchemaConfiguration configuration)
DataBoxedList validateAndBox(List<?> arg, SchemaConfiguration configuration)
DataBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration)
@Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration)

DataListBuilder

public class DataListBuilder
builder for List<Map<String, @Nullable Object>>

A class that builds the List input type

Constructor Summary

Constructor and Description
DataListBuilder()
Creates an empty list
DataListBuilder(List<Map<String, @Nullable Object>> items)
Stores the items in a list

Method Summary

Modifier and Type Method and Description
DataListBuilder add(Map<String, @Nullable Object> item)
List<Map<String, @Nullable Object>> build()
Returns list input that should be used with Schema.validate

DataList

public class DataList
extends FrozenList<ItemsSchema.ItemsSchemaMap>

A class to store validated List payloads

Method Summary

Modifier and Type Method and Description
static DataList of(List<Map<String, ? extends @Nullable Object>> arg, SchemaConfiguration configuration)

MessageBoxed

public sealed interface MessageBoxed
permits
MessageBoxedString

sealed interface that stores validated payloads using boxed classes

MessageBoxedString

public record MessageBoxedString
implements MessageBoxed

record that stores validated String payloads, sealed permits implementation

Constructor Summary

Constructor and Description
MessageBoxedString(String data)
Creates an instance, private visibility

Method Summary

Modifier and Type Method and Description
String data()
validated payload
@Nullable Object getData()
validated payload

Message

public static class Message
extends StringJsonSchema.StringJsonSchema1

A schema class that validates payloads

Methods Inherited from class org.openapijsonschematools.client.schemas.StringJsonSchema.StringJsonSchema1
validate
validateAndBox

StatusBoxed

public sealed interface StatusBoxed
permits
StatusBoxedNumber

sealed interface that stores validated payloads using boxed classes

StatusBoxedNumber

public record StatusBoxedNumber
implements StatusBoxed

record that stores validated Number payloads, sealed permits implementation

Constructor Summary

Constructor and Description
StatusBoxedNumber(Number data)
Creates an instance, private visibility

Method Summary

Modifier and Type Method and Description
Number data()
validated payload
@Nullable Object getData()
validated payload

Status

public static class Status
extends Int32JsonSchema.Int32JsonSchema1

A schema class that validates payloads

Methods Inherited from class org.openapijsonschematools.client.schemas.Int32JsonSchema.Int32JsonSchema1
validate
validateAndBox

AdditionalPropertiesBoxed

public sealed interface AdditionalPropertiesBoxed
permits
AdditionalPropertiesBoxedVoid, AdditionalPropertiesBoxedBoolean, AdditionalPropertiesBoxedNumber, AdditionalPropertiesBoxedString, AdditionalPropertiesBoxedList, AdditionalPropertiesBoxedMap

sealed interface that stores validated payloads using boxed classes

AdditionalPropertiesBoxedVoid

public record AdditionalPropertiesBoxedVoid
implements AdditionalPropertiesBoxed

record that stores validated null payloads, sealed permits implementation

Constructor Summary

Constructor and Description
AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility

Method Summary

Modifier and Type Method and Description
Void data()
validated payload
@Nullable Object getData()
validated payload

AdditionalPropertiesBoxedBoolean

public record AdditionalPropertiesBoxedBoolean
implements AdditionalPropertiesBoxed

record that stores validated boolean payloads, sealed permits implementation

Constructor Summary

Constructor and Description
AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility

Method Summary

Modifier and Type Method and Description
boolean data()
validated payload
@Nullable Object getData()
validated payload

AdditionalPropertiesBoxedNumber

public record AdditionalPropertiesBoxedNumber
implements AdditionalPropertiesBoxed

record that stores validated Number payloads, sealed permits implementation

Constructor Summary

Constructor and Description
AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility

Method Summary

Modifier and Type Method and Description
Number data()
validated payload
@Nullable Object getData()
validated payload

AdditionalPropertiesBoxedString

public record AdditionalPropertiesBoxedString
implements AdditionalPropertiesBoxed

record that stores validated String payloads, sealed permits implementation

Constructor Summary

Constructor and Description
AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility

Method Summary

Modifier and Type Method and Description
String data()
validated payload
@Nullable Object getData()
validated payload

AdditionalPropertiesBoxedList

public record AdditionalPropertiesBoxedList
implements AdditionalPropertiesBoxed

record that stores validated List payloads, sealed permits implementation

Constructor Summary

Constructor and Description
AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility

Method Summary

Modifier and Type Method and Description
FrozenList<@Nullable Object> data()
validated payload
@Nullable Object getData()
validated payload

AdditionalPropertiesBoxedMap

public record AdditionalPropertiesBoxedMap
implements AdditionalPropertiesBoxed

record that stores validated Map payloads, sealed permits implementation

Constructor Summary

Constructor and Description
AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility

Method Summary

Modifier and Type Method and Description
FrozenMap<@Nullable Object> data()
validated payload
@Nullable Object getData()
validated payload

AdditionalProperties

public static class AdditionalProperties
extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1

A schema class that validates payloads

Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1
validate
validateAndBox

[Back to top] [Back to Component Schemas] [Back to README]