Class OffsetAndMetadata


  • public class OffsetAndMetadata
    extends Object
    Provide additional metadata when an offset is committed
    • Constructor Detail

      • OffsetAndMetadata

        public OffsetAndMetadata()
        Constructor
      • OffsetAndMetadata

        public OffsetAndMetadata​(long offset,
                                 String metadata)
        Constructor
        Parameters:
        offset - offset to commit
        metadata - additional metadata with the offset committed
      • OffsetAndMetadata

        public OffsetAndMetadata​(JsonObject json)
        Constructor (from JSON representation)
        Parameters:
        json - JSON representation
      • OffsetAndMetadata

        public OffsetAndMetadata​(OffsetAndMetadata that)
        Constructor (copy)
        Parameters:
        that - object to copy
    • Method Detail

      • getOffset

        public long getOffset()
        Returns:
        offset to commit
      • setOffset

        public OffsetAndMetadata setOffset​(long offset)
        Set the offset to commit
        Parameters:
        offset - offset to commit
        Returns:
        current instance of the class to be fluent
      • getMetadata

        public String getMetadata()
        Returns:
        additional metadata with the offset committed
      • setMetadata

        public OffsetAndMetadata setMetadata​(String metadata)
        Set additional metadata for the offset committed
        Parameters:
        metadata - additional metadata
        Returns:
        current instance of the class to be fluent
      • toJson

        public JsonObject toJson()
        Convert object to JSON representation
        Returns:
        JSON representation