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

Latest commit

 

History

History
90 lines (69 loc) · 4.94 KB

File metadata and controls

90 lines (69 loc) · 4.94 KB

SuccessWithJsonApiResponse

SuccessWithJsonApiResponse.java

public class SuccessWithJsonApiResponse

A class that contains necessary nested response classes

  • SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType
  • records which implement SealedMediaType, the concrete media types
  • SealedResponseBody, a sealed interface which contains all the contentType/schema types
  • records which implement SealedResponseBody, the concrete response body types
  • a class that extends ResponseDeserializer and is used to deserialize responses

Nested Class Summary

Modifier and Type Class and Description
sealed interface SuccessWithJsonApiResponse.SealedMediaType
media type sealed interface
record SuccessWithJsonApiResponse.ApplicationjsonMediaType
record storing schema + encoding for a specific contentType
sealed interface SuccessWithJsonApiResponse.SealedResponseBody
response body sealed interface
record SuccessWithJsonApiResponse.ApplicationjsonResponseBody
implements sealed interface to store response body
static class SuccessWithJsonApiResponse.SuccessWithJsonApiResponse1
class that deserializes responses

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

SealedResponseBody

public sealed interface SealedResponseBody
permits
ApplicationjsonResponseBody

sealed interface that stores response body

ApplicationjsonResponseBody

public record ApplicationjsonResponseBody
implements SealedResponseBody

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

Constructor Summary

Constructor and Description
ApplicationjsonResponseBody(ApplicationjsonSchema.ApiResponseSchema1Boxed body)
Creates an instance

Method Summary

Modifier and Type Method and Description
ApplicationjsonSchema.ApiResponseSchema1Boxed body()
returns the body passed in in the constructor

SuccessWithJsonApiResponse1

public static class SuccessWithJsonApiResponse1
extends ResponseDeserializer<SealedResponseBody, SuccessWithJsonApiResponseHeadersSchema.SuccessWithJsonApiResponseHeadersSchemaMap, SealedMediaType>

a class that deserializes responses

Constructor Summary

Constructor and Description
SuccessWithJsonApiResponse1()
Creates an instance

Field Summary

Modifier and Type Field and Description
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
ApiResponse<SealedResponseBody, SuccessWithJsonApiResponseHeadersSchema.SuccessWithJsonApiResponseHeadersSchemaMap> deserialize(HttpResponse<byte[]> response, SchemaConfiguration configuration)
called by endpoint when deserialize responses

[Back to top] [Back to Component Responses] [Back to README]