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

Latest commit

 

History

History
197 lines (159 loc) · 9.07 KB

File metadata and controls

197 lines (159 loc) · 9.07 KB

TriangleInterface

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

A class that contains necessary nested

  • schema classes (which validate payloads), extends JsonSchema
  • 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
static class TriangleInterface.TriangleInterface1
schema class
static class TriangleInterface.TriangleInterfaceMapBuilder
builder for Map payloads
static class TriangleInterface.TriangleInterfaceMap
output class for Map payloads
static class TriangleInterface.TriangleType
schema class
static class TriangleInterface.ShapeType
schema class
enum TriangleInterface.StringShapeTypeEnums
String enum

TriangleInterface1

public static class TriangleInterface1
extends JsonSchema

A schema class that validates payloads

Field Summary

Modifier and Type Field and Description
Map<String, Class<? extends JsonSchema>> properties = Map.ofEntries(
    new PropertyEntry("shapeType", ShapeType.class)),
    new PropertyEntry("triangleType", TriangleType.class))
)
Set required = Set.of(
    "shapeType",
    "triangleType"
)

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)
boolean validate(boolean arg, SchemaConfiguration configuration)
TriangleInterfaceMap validate(Map<?, ?> arg, SchemaConfiguration configuration)
FrozenList<@Nullable Object> validate(List<?> arg, SchemaConfiguration configuration)
@Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration)

TriangleInterfaceMap00Builder

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

A class that builds the Map input type

Constructor Summary

Constructor and Description
TriangleInterfaceMap00Builder(Map<String, @Nullable Object> instance)
Creates a builder that contains the passed instance

Method Summary

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

TriangleInterfaceMap01Builder

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

A class that builds the Map input type

Constructor Summary

Constructor and Description
TriangleInterfaceMap01Builder(Map<String, @Nullable Object> instance)
Creates a builder that contains the passed instance

Method Summary

Modifier and Type Method and Description
TriangleInterfaceMap00Builder triangleType(String value)

TriangleInterfaceMap10Builder

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

A class that builds the Map input type

Constructor Summary

Constructor and Description
TriangleInterfaceMap10Builder(Map<String, @Nullable Object> instance)
Creates a builder that contains the passed instance

Method Summary

Modifier and Type Method and Description
TriangleInterfaceMap00Builder shapeType(String value)
TriangleInterfaceMap00Builder shapeType(StringShapeTypeEnums value)

TriangleInterfaceMapBuilder

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

A class that builds the Map input type

Constructor Summary

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

Method Summary

Modifier and Type Method and Description
TriangleInterfaceMap01Builder shapeType(String value)
TriangleInterfaceMap01Builder shapeType(StringShapeTypeEnums value)
TriangleInterfaceMap10Builder triangleType(String value)

TriangleInterfaceMap

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

A class to store validated Map payloads

Method Summary

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

TriangleType

public static class TriangleType
extends StringJsonSchema

A schema class that validates payloads

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

ShapeType

public static class ShapeType
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 java.util.Arrays;
import java.util.List;
import java.util.AbstractMap;

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

// String validation
String validatedPayload = TriangleInterface.ShapeType.validate(
    "Triangle",
    configuration
);

Field Summary

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

Method Summary

Modifier and Type Method and Description
String validate(String arg, SchemaConfiguration configuration)
String validate(StringShapeTypeEnums arg, SchemaConfiguration configuration)
@Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration)

StringShapeTypeEnums

public enum StringShapeTypeEnums
extends Enum<StringShapeTypeEnums>

A class that stores String enum values

Enum Constant Summary

Enum Constant Description
TRIANGLE value = "Triangle"

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