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

Latest commit

 

History

History
205 lines (161 loc) · 9.89 KB

ObjectWithNonIntersectingValues.md

File metadata and controls

205 lines (161 loc) · 9.89 KB

ObjectWithNonIntersectingValues

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

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

Nested Class Summary

Modifier and Type Class and Description
sealed interface ObjectWithNonIntersectingValues.ObjectWithNonIntersectingValues1Boxed
sealed interface for validated payloads
record ObjectWithNonIntersectingValues.ObjectWithNonIntersectingValues1BoxedMap
boxed class to store validated Map payloads
static class ObjectWithNonIntersectingValues.ObjectWithNonIntersectingValues1
schema class
static class ObjectWithNonIntersectingValues.ObjectWithNonIntersectingValuesMapBuilder
builder for Map payloads
static class ObjectWithNonIntersectingValues.ObjectWithNonIntersectingValuesMap
output class for Map payloads
sealed interface ObjectWithNonIntersectingValues.ABoxed
sealed interface for validated payloads
record ObjectWithNonIntersectingValues.ABoxedNumber
boxed class to store validated Number payloads
static class ObjectWithNonIntersectingValues.A
schema class
sealed interface ObjectWithNonIntersectingValues.AdditionalPropertiesBoxed
sealed interface for validated payloads
record ObjectWithNonIntersectingValues.AdditionalPropertiesBoxedString
boxed class to store validated String payloads
static class ObjectWithNonIntersectingValues.AdditionalProperties
schema class

ObjectWithNonIntersectingValues1Boxed

public sealed interface ObjectWithNonIntersectingValues1Boxed
permits
ObjectWithNonIntersectingValues1BoxedMap

sealed interface that stores validated payloads using boxed classes

ObjectWithNonIntersectingValues1BoxedMap

public record ObjectWithNonIntersectingValues1BoxedMap
implements ObjectWithNonIntersectingValues1Boxed

record that stores validated Map payloads, sealed permits implementation

Constructor Summary

Constructor and Description
ObjectWithNonIntersectingValues1BoxedMap(ObjectWithNonIntersectingValuesMap data)
Creates an instance, private visibility

Method Summary

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

ObjectWithNonIntersectingValues1

public static class ObjectWithNonIntersectingValues1
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.ObjectWithNonIntersectingValues;

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

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

// Map validation
ObjectWithNonIntersectingValues.ObjectWithNonIntersectingValuesMap validatedPayload =
    ObjectWithNonIntersectingValues.ObjectWithNonIntersectingValues1.validate(
    new ObjectWithNonIntersectingValues.ObjectWithNonIntersectingValuesMapBuilder()
        .a(1)

        .additionalProperty("someAdditionalProperty", "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("a", A.class))
)
Class<? extends JsonSchema> additionalProperties = AdditionalProperties.class

Method Summary

Modifier and Type Method and Description
ObjectWithNonIntersectingValuesMap validate(Map<?, ?> arg, SchemaConfiguration configuration)
ObjectWithNonIntersectingValues1BoxedMap validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration)
ObjectWithNonIntersectingValues1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration)
@Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration)

ObjectWithNonIntersectingValuesMapBuilder

public class ObjectWithNonIntersectingValuesMapBuilder
builder for Map<String, Object>

A class that builds the Map input type

Constructor Summary

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

Method Summary

Modifier and Type Method and Description
Map<String, Object> build()
Returns map input that should be used with Schema.validate
ObjectWithNonIntersectingValuesMapBuilder a(int value)
ObjectWithNonIntersectingValuesMapBuilder a(float value)
ObjectWithNonIntersectingValuesMapBuilder a(long value)
ObjectWithNonIntersectingValuesMapBuilder a(double value)
ObjectWithNonIntersectingValuesMapBuilder additionalProperty(String key, String value)

ObjectWithNonIntersectingValuesMap

public static class ObjectWithNonIntersectingValuesMap
extends FrozenMap<String, Object>

A class to store validated Map payloads

Method Summary

Modifier and Type Method and Description
static ObjectWithNonIntersectingValuesMap of(Map<String, Object> arg, SchemaConfiguration configuration)
Number a()
[optional]
String getAdditionalProperty(String name)
provides type safety for additional properties

ABoxed

public sealed interface ABoxed
permits
ABoxedNumber

sealed interface that stores validated payloads using boxed classes

ABoxedNumber

public record ABoxedNumber
implements ABoxed

record that stores validated Number payloads, sealed permits implementation

Constructor Summary

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

Method Summary

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

A

public static class A
extends NumberJsonSchema.NumberJsonSchema1

A schema class that validates payloads

Methods Inherited from class org.openapijsonschematools.client.schemas.NumberJsonSchema.NumberJsonSchema1
validate
validateAndBox

AdditionalPropertiesBoxed

public sealed interface AdditionalPropertiesBoxed
permits
AdditionalPropertiesBoxedString

sealed interface that stores validated payloads using boxed classes

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

AdditionalProperties

public static class AdditionalProperties
extends StringJsonSchema.StringJsonSchema1

A schema class that validates payloads

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

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