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

Latest commit

 

History

History
169 lines (136 loc) · 7.16 KB

File metadata and controls

169 lines (136 loc) · 7.16 KB

Shape

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

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 Shape.Shape1Boxed
sealed interface for validated payloads
record Shape.Shape1BoxedVoid
boxed class to store validated null payloads
record Shape.Shape1BoxedBoolean
boxed class to store validated boolean payloads
record Shape.Shape1BoxedNumber
boxed class to store validated Number payloads
record Shape.Shape1BoxedString
boxed class to store validated String payloads
record Shape.Shape1BoxedList
boxed class to store validated List payloads
record Shape.Shape1BoxedMap
boxed class to store validated Map payloads
static class Shape.Shape1
schema class

Shape1Boxed

public sealed interface Shape1Boxed
permits
Shape1BoxedVoid, Shape1BoxedBoolean, Shape1BoxedNumber, Shape1BoxedString, Shape1BoxedList, Shape1BoxedMap

sealed interface that stores validated payloads using boxed classes

Shape1BoxedVoid

public record Shape1BoxedVoid
implements Shape1Boxed

record that stores validated null payloads, sealed permits implementation

Constructor Summary

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

Method Summary

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

Shape1BoxedBoolean

public record Shape1BoxedBoolean
implements Shape1Boxed

record that stores validated boolean payloads, sealed permits implementation

Constructor Summary

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

Method Summary

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

Shape1BoxedNumber

public record Shape1BoxedNumber
implements Shape1Boxed

record that stores validated Number payloads, sealed permits implementation

Constructor Summary

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

Method Summary

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

Shape1BoxedString

public record Shape1BoxedString
implements Shape1Boxed

record that stores validated String payloads, sealed permits implementation

Constructor Summary

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

Method Summary

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

Shape1BoxedList

public record Shape1BoxedList
implements Shape1Boxed

record that stores validated List payloads, sealed permits implementation

Constructor Summary

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

Shape1BoxedMap

public record Shape1BoxedMap
implements Shape1Boxed

record that stores validated Map payloads, sealed permits implementation

Constructor Summary

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

Shape1

public static class Shape1
extends JsonSchema

A schema class that validates payloads

Field Summary

Modifier and Type Field and Description
List<Class<? extends JsonSchema>> oneOf = List.of(
    Triangle.Triangle1.class,
    Quadrilateral.Quadrilateral1.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)
Shape1BoxedString validateAndBox(String arg, SchemaConfiguration configuration)
Shape1BoxedVoid validateAndBox(Void arg, SchemaConfiguration configuration)
Shape1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration)
Shape1BoxedBoolean validateAndBox(boolean arg, SchemaConfiguration configuration)
Shape1BoxedMap validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration)
Shape1BoxedList validateAndBox(List<?> arg, SchemaConfiguration configuration)
Shape1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration)
@Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration)

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