Package io.datareplication.consumer
Class StreamingPage.Chunk<EntityHeader>
- java.lang.Object
-
- io.datareplication.consumer.StreamingPage.Chunk<EntityHeader>
-
- Type Parameters:
EntityHeader
- the type of the entity headers; seeEntity
- Direct Known Subclasses:
StreamingPage.Chunk.BodyChunk
,StreamingPage.Chunk.BodyEnd
,StreamingPage.Chunk.Header
- Enclosing interface:
- StreamingPage<PageHeader extends ToHttpHeaders,EntityHeader extends ToHttpHeaders>
public static class StreamingPage.Chunk<EntityHeader> extends java.lang.Object
An element in aStreamingPage
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
StreamingPage.Chunk.BodyChunk<EntityHeader>
A block of data of the current entity's body.static class
StreamingPage.Chunk.BodyEnd<EntityHeader>
Represents the end of an entity.static class
StreamingPage.Chunk.Header<EntityHeader>
Represents the start of an entity.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <EntityHeader>
@NonNull StreamingPage.Chunk.BodyChunk<EntityHeader>bodyChunk(@NonNull java.nio.ByteBuffer data)
Create a newStreamingPage.Chunk.BodyChunk
.static <EntityHeader>
@NonNull StreamingPage.Chunk.BodyEnd<EntityHeader>bodyEnd()
Return aStreamingPage.Chunk.BodyEnd
marker.static <EntityHeader>
@NonNull StreamingPage.Chunk.Header<EntityHeader>header(EntityHeader header, @NonNull ContentType contentType)
Create a newStreamingPage.Chunk.Header
.
-
-
-
Method Detail
-
header
@NonNull public static <EntityHeader> @NonNull StreamingPage.Chunk.Header<EntityHeader> header(@NonNull EntityHeader header, @NonNull @NonNull ContentType contentType)
Create a newStreamingPage.Chunk.Header
.- Type Parameters:
EntityHeader
- the entity's header- Parameters:
header
- the entity's header objectcontentType
- the entity's content type- Returns:
- a new
StreamingPage.Chunk.Header
-
bodyChunk
@NonNull public static <EntityHeader> @NonNull StreamingPage.Chunk.BodyChunk<EntityHeader> bodyChunk(@NonNull @NonNull java.nio.ByteBuffer data)
Create a newStreamingPage.Chunk.BodyChunk
.- Type Parameters:
EntityHeader
- the entity's header- Parameters:
data
- the data chunk; this buffer should beByteBuffer.slice()
d and not shared to avoid ByteBuffer's mutability leaking out and causing problems- Returns:
- a new
StreamingPage.Chunk.BodyChunk
-
bodyEnd
@NonNull public static <EntityHeader> @NonNull StreamingPage.Chunk.BodyEnd<EntityHeader> bodyEnd()
Return aStreamingPage.Chunk.BodyEnd
marker.- Type Parameters:
EntityHeader
- the entity's header- Returns:
- a
StreamingPage.Chunk.BodyEnd
marker
-
-