Class Segment

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Segment>

    public class Segment
    extends java.lang.Object
    implements java.lang.Comparable<Segment>, java.io.Serializable
    An identifier for a segment of a stream.
    See Also:
    Serialized Form
    • Constructor Detail

      • Segment

        public Segment​(java.lang.String scope,
                       java.lang.String streamName,
                       long id)
        Creates a new instance of Segment class.
        Parameters:
        scope - The scope string the segment belongs to.
        streamName - The stream name that the segment belongs to.
        id - ID number for the segment.
    • Method Detail

      • getScopedStreamName

        public java.lang.String getScopedStreamName()
      • getScopedName

        public java.lang.String getScopedName()
      • getKVTScopedName

        public java.lang.String getKVTScopedName()
      • getStream

        public Stream getStream()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • fromScopedName

        public static Segment fromScopedName​(java.lang.String qualifiedName)
        Parses fully scoped name, and creates the segment.
        Parameters:
        qualifiedName - Fully scoped segment name
        Returns:
        Segment name.
      • compareTo

        public int compareTo​(Segment o)
        Specified by:
        compareTo in interface java.lang.Comparable<Segment>
      • getScope

        public java.lang.String getScope()
      • getStreamName

        @NonNull
        public @NonNull java.lang.String getStreamName()
      • getSegmentId

        public long getSegmentId()
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • canEqual

        protected boolean canEqual​(java.lang.Object other)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object