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.62 KB

File metadata and controls

93 lines (71 loc) · 4.62 KB

UserArray

UserArray.java

public class UserArray

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 UserArray.SealedMediaType
media type sealed interface
record UserArray.ApplicationjsonMediaType
record storing schema + encoding for a specific contentType
static class UserArray.UserArray1
class that serializes request bodies
sealed interface UserArray.SealedRequestBody
request body sealed interface
record UserArray.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

UserArray1

public static class UserArray1

a class that serializes SealedRequestBody request bodies

Constructor Summary

Constructor and Description
UserArray1()
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.ApplicationjsonSchema1Boxed>

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

Constructor Summary

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

Method Summary

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

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