Package io.pravega.client.stream.impl
Class StreamCutImpl
- java.lang.Object
-
- io.pravega.client.stream.impl.StreamCutInternal
-
- io.pravega.client.stream.impl.StreamCutImpl
-
- All Implemented Interfaces:
StreamCut
,java.io.Serializable
public class StreamCutImpl extends StreamCutInternal
Implementation ofStreamCut
interface.StreamCutInternal
abstract class is used as in intermediate class to make StreamCut instances opaque.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
StreamCutImpl.StreamCutSerializer
-
Constructor Summary
Constructors Constructor Description StreamCutImpl(Stream stream, java.util.Map<Segment,java.lang.Long> positions)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StreamCutInternal
asImpl()
Used internally.java.lang.String
asText()
Obtains the compact base64 string representation of StreamCut.static io.pravega.client.stream.impl.StreamCutImpl.StreamCutBuilder
builder()
protected boolean
canEqual(java.lang.Object other)
boolean
equals(java.lang.Object o)
static StreamCutInternal
from(java.lang.String base64String)
Obtains the a StreamCut object from its compact Base64 representation obtained viaasText()
.static StreamCutInternal
fromBytes(java.nio.ByteBuffer buff)
Deserializes the cut from its serialized from obtained from callingStreamCut.toBytes()
.java.util.Map<Segment,java.lang.Long>
getPositions()
Get a mapping of Segment and its offset.Stream
getStream()
GetStream
for the StreamCut.int
hashCode()
java.nio.ByteBuffer
toBytes()
Serializes the cut to a compact byte array.java.lang.String
toString()
boolean
validate(java.util.Set<java.lang.String> segmentNames)
-
-
-
Method Detail
-
getPositions
public java.util.Map<Segment,java.lang.Long> getPositions()
Description copied from class:StreamCutInternal
Get a mapping of Segment and its offset.- Specified by:
getPositions
in classStreamCutInternal
- Returns:
- Map of Segment to its offset.
-
getStream
public Stream getStream()
Description copied from class:StreamCutInternal
GetStream
for the StreamCut.- Specified by:
getStream
in classStreamCutInternal
- Returns:
- The stream.
-
asImpl
public StreamCutInternal asImpl()
Description copied from interface:StreamCut
Used internally. Do not call.- Returns:
- Implementation of EventPointer interface
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
asText
public java.lang.String asText()
Description copied from interface:StreamCut
Obtains the compact base64 string representation of StreamCut.- Returns:
- Base64 representation of the StreamCut.
-
from
public static StreamCutInternal from(java.lang.String base64String)
Obtains the a StreamCut object from its compact Base64 representation obtained viaasText()
.- Parameters:
base64String
- Compact Base64 representation of StreamCut.- Returns:
- The StreamCut object.
-
validate
public boolean validate(java.util.Set<java.lang.String> segmentNames)
-
toBytes
public java.nio.ByteBuffer toBytes()
Description copied from interface:StreamCut
Serializes the cut to a compact byte array.- Returns:
- A serialized version of this streamcut.
-
fromBytes
public static StreamCutInternal fromBytes(java.nio.ByteBuffer buff)
Description copied from interface:StreamCut
Deserializes the cut from its serialized from obtained from callingStreamCut.toBytes()
.- Parameters:
buff
- A serialized position.- Returns:
- The StreamCut object.
-
builder
public static io.pravega.client.stream.impl.StreamCutImpl.StreamCutBuilder builder()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-