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

Latest commit

 

History

History
93 lines (71 loc) · 4.33 KB

File metadata and controls

93 lines (71 loc) · 4.33 KB

Client

Client.java

public class Client

A class that contains necessary nested request body classes

  • SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType
  • records which implement SealedMediaType, the concrete media types
  • a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances
  • SealedRequestBody, a sealed interface which contains all the contentType/schema input types
  • records which implement SealedRequestBody, the concrete request body types

Nested Class Summary

Modifier and Type Class and Description
sealed interface Client.SealedMediaType
media type sealed interface
record Client.ApplicationjsonMediaType
record storing schema + encoding for a specific contentType
static class Client.Client1
class that serializes request bodies
sealed interface Client.SealedRequestBody
request body sealed interface
record Client.ApplicationjsonRequestBody
implements sealed interface to store request body input

SealedMediaType

public sealed interface SealedMediaType
permits
ApplicationjsonMediaType

sealed interface that stores schema and encoding info

ApplicationjsonMediaType

public record ApplicationjsonMediaType
implements SealedMediaType, MediaType<ApplicationjsonSchema.ApplicationjsonSchema1, Void>

class storing schema info for a specific contentType

Constructor Summary

Constructor and Description
ApplicationjsonMediaType()
Creates an instance

Method Summary

Modifier and Type Method and Description
ApplicationjsonSchema.ApplicationjsonSchema1 schema()
the schema for this MediaType
Void encoding()
the encoding info

Client1

public static class Client1

a class that serializes SealedRequestBody request bodies

Constructor Summary

Constructor and Description
Client1()
Creates an instance

Field Summary

Modifier and Type Field and Description
boolean required = true
whether the request body is required
Map<String, SealedMediaType> content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType())
)
the contentType to schema info

Method Summary

Modifier and Type Method and Description
SerializedRequestBody serialize(SealedRequestBody requestBody)
called by endpoint when creating request body bytes

SealedRequestBody

public sealed interface SealedRequestBody
permits
ApplicationjsonRequestBody

sealed interface that stores request contentType + validated schema data

ApplicationjsonRequestBody

public record ApplicationjsonRequestBody
implements SealedRequestBody,
GenericRequestBody<ApplicationjsonSchema.Client1Boxed>

A record class to store request body input for contentType="application/json"

Constructor Summary

Constructor and Description
ApplicationjsonRequestBody(ApplicationjsonSchema.Client1Boxed body)
Creates an instance

Method Summary

Modifier and Type Method and Description
String contentType()
always returns "application/json"
ApplicationjsonSchema.Client1Boxed body()
returns the body passed in in the constructor

[Back to top] [Back to Component RequestBodies] [Back to README]