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 ofStreamCutinterface.StreamCutInternalabstract 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 classStreamCutImpl.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 StreamCutInternalasImpl()Used internally.java.lang.StringasText()Obtains the compact base64 string representation of StreamCut.static io.pravega.client.stream.impl.StreamCutImpl.StreamCutBuilderbuilder()protected booleancanEqual(java.lang.Object other)booleanequals(java.lang.Object o)static StreamCutInternalfrom(java.lang.String base64String)Obtains the a StreamCut object from its compact Base64 representation obtained viaasText().static StreamCutInternalfromBytes(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.StreamgetStream()GetStreamfor the StreamCut.inthashCode()java.nio.ByteBuffertoBytes()Serializes the cut to a compact byte array.java.lang.StringtoString()booleanvalidate(java.util.Set<java.lang.String> segmentNames)
-
-
-
Method Detail
-
getPositions
public java.util.Map<Segment,java.lang.Long> getPositions()
Description copied from class:StreamCutInternalGet a mapping of Segment and its offset.- Specified by:
getPositionsin classStreamCutInternal- Returns:
- Map of Segment to its offset.
-
getStream
public Stream getStream()
Description copied from class:StreamCutInternalGetStreamfor the StreamCut.- Specified by:
getStreamin classStreamCutInternal- Returns:
- The stream.
-
asImpl
public StreamCutInternal asImpl()
Description copied from interface:StreamCutUsed internally. Do not call.- Returns:
- Implementation of EventPointer interface
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
asText
public java.lang.String asText()
Description copied from interface:StreamCutObtains 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:StreamCutSerializes 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:StreamCutDeserializes 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:
equalsin classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-