Skip to content

Latest commit

 

History

History
98 lines (78 loc) · 4.43 KB

File metadata and controls

98 lines (78 loc) · 4.43 KB

EnumWithFalseDoesNotMatch0

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

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
  • enum classes

Nested Class Summary

Modifier and Type Class and Description
sealed interface EnumWithFalseDoesNotMatch0.EnumWithFalseDoesNotMatch01Boxed
sealed interface for validated payloads
record EnumWithFalseDoesNotMatch0.EnumWithFalseDoesNotMatch01BoxedBoolean
boxed class to store validated boolean payloads
static class EnumWithFalseDoesNotMatch0.EnumWithFalseDoesNotMatch01
schema class
enum EnumWithFalseDoesNotMatch0.BooleanEnumWithFalseDoesNotMatch0Enums
boolean enum

EnumWithFalseDoesNotMatch01Boxed

public sealed interface EnumWithFalseDoesNotMatch01Boxed
permits
EnumWithFalseDoesNotMatch01BoxedBoolean

sealed interface that stores validated payloads using boxed classes

EnumWithFalseDoesNotMatch01BoxedBoolean

public record EnumWithFalseDoesNotMatch01BoxedBoolean
implements EnumWithFalseDoesNotMatch01Boxed

record that stores validated boolean payloads, sealed permits implementation

Constructor Summary

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

Method Summary

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

EnumWithFalseDoesNotMatch01

public static class EnumWithFalseDoesNotMatch01
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.EnumWithFalseDoesNotMatch0;

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 = EnumWithFalseDoesNotMatch0.EnumWithFalseDoesNotMatch01.validate(
    false,
    configuration
);

Field Summary

Modifier and Type Field and Description
Set<Class<?>> type = Set.of(Boolean.class)
Set enumValues = SetMaker.makeSet(
    false
)

Method Summary

Modifier and Type Method and Description
boolean validate(boolean arg, SchemaConfiguration configuration)
boolean validate(BooleanEnumWithFalseDoesNotMatch0Enums arg, SchemaConfiguration configuration)
EnumWithFalseDoesNotMatch01BoxedBoolean validateAndBox(boolean arg, SchemaConfiguration configuration)
EnumWithFalseDoesNotMatch01Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration)
@Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration)

BooleanEnumWithFalseDoesNotMatch0Enums

public enum BooleanEnumWithFalseDoesNotMatch0Enums
extends Enum<BooleanEnumWithFalseDoesNotMatch0Enums>

A class that stores boolean enum values

Enum Constant Summary

Enum Constant Description
FALSE value = false

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