Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

Latest commit

 

History

History
217 lines (171 loc) · 8.44 KB

File metadata and controls

217 lines (171 loc) · 8.44 KB

ComposedBool

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

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

Nested Class Summary

Modifier and Type Class and Description
sealed interface ComposedBool.ComposedBool1Boxed
sealed interface for validated payloads
record ComposedBool.ComposedBool1BoxedBoolean
boxed class to store validated boolean payloads
static class ComposedBool.ComposedBool1
schema class
sealed interface ComposedBool.Schema0Boxed
sealed interface for validated payloads
record ComposedBool.Schema0BoxedVoid
boxed class to store validated null payloads
record ComposedBool.Schema0BoxedBoolean
boxed class to store validated boolean payloads
record ComposedBool.Schema0BoxedNumber
boxed class to store validated Number payloads
record ComposedBool.Schema0BoxedString
boxed class to store validated String payloads
record ComposedBool.Schema0BoxedList
boxed class to store validated List payloads
record ComposedBool.Schema0BoxedMap
boxed class to store validated Map payloads
static class ComposedBool.Schema0
schema class

ComposedBool1Boxed

public sealed interface ComposedBool1Boxed
permits
ComposedBool1BoxedBoolean

sealed interface that stores validated payloads using boxed classes

ComposedBool1BoxedBoolean

public record ComposedBool1BoxedBoolean
implements ComposedBool1Boxed

record that stores validated boolean payloads, sealed permits implementation

Constructor Summary

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

Method Summary

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

ComposedBool1

public static class ComposedBool1
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.ComposedBool;

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

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

// boolean validation
boolean validatedPayload = ComposedBool.ComposedBool1.validate(
    true,
    configuration
);

Field Summary

Modifier and Type Field and Description
Set<Class<?>> type = Set.of(Boolean.class)
List<Class<? extends JsonSchema>> allOf = List.of(
    Schema0.class
;)

Method Summary

Modifier and Type Method and Description
boolean validate(boolean arg, SchemaConfiguration configuration)
ComposedBool1BoxedBoolean validateAndBox(boolean arg, SchemaConfiguration configuration)
ComposedBool1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration)
@Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration)

Schema0Boxed

public sealed interface Schema0Boxed
permits
Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap

sealed interface that stores validated payloads using boxed classes

Schema0BoxedVoid

public record Schema0BoxedVoid
implements Schema0Boxed

record that stores validated null payloads, sealed permits implementation

Constructor Summary

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

Method Summary

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

Schema0BoxedBoolean

public record Schema0BoxedBoolean
implements Schema0Boxed

record that stores validated boolean payloads, sealed permits implementation

Constructor Summary

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

Method Summary

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

Schema0BoxedNumber

public record Schema0BoxedNumber
implements Schema0Boxed

record that stores validated Number payloads, sealed permits implementation

Constructor Summary

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

Method Summary

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

Schema0BoxedString

public record Schema0BoxedString
implements Schema0Boxed

record that stores validated String payloads, sealed permits implementation

Constructor Summary

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

Method Summary

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

Schema0BoxedList

public record Schema0BoxedList
implements Schema0Boxed

record that stores validated List payloads, sealed permits implementation

Constructor Summary

Constructor and Description
Schema0BoxedList(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

Schema0BoxedMap

public record Schema0BoxedMap
implements Schema0Boxed

record that stores validated Map payloads, sealed permits implementation

Constructor Summary

Constructor and Description
Schema0BoxedMap(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

Schema0

public static class Schema0
extends AnyTypeJsonSchema.AnyTypeJsonSchema1

A schema class that validates payloads

Methods Inherited from class org.openapijsonschematools.client.schemas.AnyTypeJsonSchema.AnyTypeJsonSchema1
validate
validateAndBox

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