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

Latest commit

 

History

History
371 lines (299 loc) · 16.6 KB

File metadata and controls

371 lines (299 loc) · 16.6 KB

ScaleneTriangle

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

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

Nested Class Summary

Modifier and Type Class and Description
sealed interface ScaleneTriangle.ScaleneTriangle1Boxed
sealed interface for validated payloads
record ScaleneTriangle.ScaleneTriangle1BoxedVoid
boxed class to store validated null payloads
record ScaleneTriangle.ScaleneTriangle1BoxedBoolean
boxed class to store validated boolean payloads
record ScaleneTriangle.ScaleneTriangle1BoxedNumber
boxed class to store validated Number payloads
record ScaleneTriangle.ScaleneTriangle1BoxedString
boxed class to store validated String payloads
record ScaleneTriangle.ScaleneTriangle1BoxedList
boxed class to store validated List payloads
record ScaleneTriangle.ScaleneTriangle1BoxedMap
boxed class to store validated Map payloads
static class ScaleneTriangle.ScaleneTriangle1
schema class
sealed interface ScaleneTriangle.Schema1Boxed
sealed interface for validated payloads
record ScaleneTriangle.Schema1BoxedMap
boxed class to store validated Map payloads
static class ScaleneTriangle.Schema1
schema class
static class ScaleneTriangle.Schema1MapBuilder
builder for Map payloads
static class ScaleneTriangle.Schema1Map
output class for Map payloads
sealed interface ScaleneTriangle.TriangleTypeBoxed
sealed interface for validated payloads
record ScaleneTriangle.TriangleTypeBoxedString
boxed class to store validated String payloads
static class ScaleneTriangle.TriangleType
schema class
enum ScaleneTriangle.StringTriangleTypeEnums
String enum

ScaleneTriangle1Boxed

public sealed interface ScaleneTriangle1Boxed
permits
ScaleneTriangle1BoxedVoid, ScaleneTriangle1BoxedBoolean, ScaleneTriangle1BoxedNumber, ScaleneTriangle1BoxedString, ScaleneTriangle1BoxedList, ScaleneTriangle1BoxedMap

sealed interface that stores validated payloads using boxed classes

ScaleneTriangle1BoxedVoid

public record ScaleneTriangle1BoxedVoid
implements ScaleneTriangle1Boxed

record that stores validated null payloads, sealed permits implementation

Constructor Summary

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

Method Summary

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

ScaleneTriangle1BoxedBoolean

public record ScaleneTriangle1BoxedBoolean
implements ScaleneTriangle1Boxed

record that stores validated boolean payloads, sealed permits implementation

Constructor Summary

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

Method Summary

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

ScaleneTriangle1BoxedNumber

public record ScaleneTriangle1BoxedNumber
implements ScaleneTriangle1Boxed

record that stores validated Number payloads, sealed permits implementation

Constructor Summary

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

Method Summary

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

ScaleneTriangle1BoxedString

public record ScaleneTriangle1BoxedString
implements ScaleneTriangle1Boxed

record that stores validated String payloads, sealed permits implementation

Constructor Summary

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

Method Summary

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

ScaleneTriangle1BoxedList

public record ScaleneTriangle1BoxedList
implements ScaleneTriangle1Boxed

record that stores validated List payloads, sealed permits implementation

Constructor Summary

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

ScaleneTriangle1BoxedMap

public record ScaleneTriangle1BoxedMap
implements ScaleneTriangle1Boxed

record that stores validated Map payloads, sealed permits implementation

Constructor Summary

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

ScaleneTriangle1

public static class ScaleneTriangle1
extends JsonSchema

A schema class that validates payloads

Field Summary

Modifier and Type Field and Description
List<Class<? extends JsonSchema>> allOf = List.of(
    TriangleInterface.TriangleInterface1.class,
    Schema1.class
;)

Method Summary

Modifier and Type Method and Description
String validate(String arg, SchemaConfiguration configuration)
Void validate(Void arg, SchemaConfiguration configuration)
int validate(int arg, SchemaConfiguration configuration)
long validate(long arg, SchemaConfiguration configuration)
float validate(float arg, SchemaConfiguration configuration)
double validate(double arg, SchemaConfiguration configuration)
Number validate(Number arg, SchemaConfiguration configuration)
boolean validate(boolean arg, SchemaConfiguration configuration)
FrozenMap<@Nullable Object> validate(Map<?, ?> arg, SchemaConfiguration configuration)
FrozenList<@Nullable Object> validate(List<?> arg, SchemaConfiguration configuration)
ScaleneTriangle1BoxedString validateAndBox(String arg, SchemaConfiguration configuration)
ScaleneTriangle1BoxedVoid validateAndBox(Void arg, SchemaConfiguration configuration)
ScaleneTriangle1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration)
ScaleneTriangle1BoxedBoolean validateAndBox(boolean arg, SchemaConfiguration configuration)
ScaleneTriangle1BoxedMap validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration)
ScaleneTriangle1BoxedList validateAndBox(List<?> arg, SchemaConfiguration configuration)
ScaleneTriangle1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration)
@Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration)

Schema1Boxed

public sealed interface Schema1Boxed
permits
Schema1BoxedMap

sealed interface that stores validated payloads using boxed classes

Schema1BoxedMap

public record Schema1BoxedMap
implements Schema1Boxed

record that stores validated Map payloads, sealed permits implementation

Constructor Summary

Constructor and Description
Schema1BoxedMap(Schema1Map data)
Creates an instance, private visibility

Method Summary

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

Schema1

public static class Schema1
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.ScaleneTriangle;

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

static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone());

// Map validation
ScaleneTriangle.Schema1Map validatedPayload =
    ScaleneTriangle.Schema1.validate(
    new ScaleneTriangle.Schema1MapBuilder()
        .triangleType("ScaleneTriangle")

    .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("triangleType", TriangleType.class))
)

Method Summary

Modifier and Type Method and Description
Schema1Map validate(Map<?, ?> arg, SchemaConfiguration configuration)
Schema1BoxedMap validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration)
Schema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration)
@Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration)

Schema1MapBuilder

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

A class that builds the Map input type

Constructor Summary

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

Method Summary

Modifier and Type Method and Description
Map<String, @Nullable Object> build()
Returns map input that should be used with Schema.validate
Schema1MapBuilder triangleType(String value)
Schema1MapBuilder triangleType(StringTriangleTypeEnums value)
Schema1MapBuilder additionalProperty(String key, Void value)
Schema1MapBuilder additionalProperty(String key, boolean value)
Schema1MapBuilder additionalProperty(String key, String value)
Schema1MapBuilder additionalProperty(String key, int value)
Schema1MapBuilder additionalProperty(String key, float value)
Schema1MapBuilder additionalProperty(String key, long value)
Schema1MapBuilder additionalProperty(String key, double value)
Schema1MapBuilder additionalProperty(String key, List<?> value)
Schema1MapBuilder additionalProperty(String key, Map<String, ?> value)

Schema1Map

public static class Schema1Map
extends FrozenMap<String, @Nullable Object>

A class to store validated Map payloads

Method Summary

Modifier and Type Method and Description
static Schema1Map of(Map<String, ? extends @Nullable Object> arg, SchemaConfiguration configuration)
String triangleType()
[optional] must be one of ["ScaleneTriangle"]
@Nullable Object getAdditionalProperty(String name)
provides type safety for additional properties

TriangleTypeBoxed

public sealed interface TriangleTypeBoxed
permits
TriangleTypeBoxedString

sealed interface that stores validated payloads using boxed classes

TriangleTypeBoxedString

public record TriangleTypeBoxedString
implements TriangleTypeBoxed

record that stores validated String payloads, sealed permits implementation

Constructor Summary

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

Method Summary

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

TriangleType

public static class TriangleType
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.ScaleneTriangle;

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

static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone());

// String validation
String validatedPayload = ScaleneTriangle.TriangleType.validate(
    "ScaleneTriangle",
    configuration
);

Field Summary

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

Method Summary

Modifier and Type Method and Description
String validate(String arg, SchemaConfiguration configuration)
String validate(StringTriangleTypeEnums arg, SchemaConfiguration configuration)
TriangleTypeBoxedString validateAndBox(String arg, SchemaConfiguration configuration)
TriangleTypeBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration)
@Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration)

StringTriangleTypeEnums

public enum StringTriangleTypeEnums
extends Enum<StringTriangleTypeEnums>

A class that stores String enum values

Enum Constant Summary

Enum Constant Description
SCALENE_TRIANGLE value = "ScaleneTriangle"

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