/*
 * Copyright 2019 Red Hat Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package io.vertx.kafka.admin;

import io.vertx.codegen.annotations.DataObject;
import io.vertx.core.json.JsonObject;

@DataObject(generateConverter = true)
public class ListOffsetsResultInfo {
  private long offset;
  private long timestamp;
  private Integer leaderEpoch;

  
Constructor
Params:
  • offset – the offset
  • timestamp – the timestamp
  • leaderEpoch – the leader epoch
/** * Constructor * * @param offset the offset * @param timestamp the timestamp * @param leaderEpoch the leader epoch */
public ListOffsetsResultInfo(long offset, long timestamp, Integer leaderEpoch) { this.offset = offset; this.timestamp = timestamp; this.leaderEpoch = leaderEpoch; }
Constructor (from JSON representation)
Params:
  • json – JSON representation
/** * Constructor (from JSON representation) * * @param json JSON representation */
public ListOffsetsResultInfo(JsonObject json) { ListOffsetsResultInfoConverter.fromJson(json, this); }
Returns:the offset
/** * @return the offset */
public long getOffset() { return offset; }
Returns:the timestamp
/** * @return the timestamp */
public long getTimestamp() { return timestamp; }
Returns:the leader epoch
/** * @return the leader epoch */
public Integer getLeaderEpoch() { return leaderEpoch; }
Set the offset
Params:
  • offset – the offset
Returns:current instance of the class to be fluent
/** * Set the offset * * @param offset the offset * @return current instance of the class to be fluent */
public ListOffsetsResultInfo setOffset(long offset) { this.offset = offset; return this; }
Set the timestamp
Params:
  • timestamp – the timestamp
Returns:current instance of the class to be fluent
/** * Set the timestamp * * @param timestamp the timestamp * @return current instance of the class to be fluent */
public ListOffsetsResultInfo setTimestamp(long timestamp) { this.timestamp = timestamp; return this; }
Set the leader epoch
Params:
  • leaderEpoch – the leader epoch
Returns:current instance of the class to be fluent
/** * Set the leader epoch * * @param leaderEpoch the leader epoch * @return current instance of the class to be fluent */
public ListOffsetsResultInfo setLeaderEpoch(Integer leaderEpoch) { this.leaderEpoch = leaderEpoch; return this; }
Convert object to JSON representation
Returns: JSON representation
/** * Convert object to JSON representation * * @return JSON representation */
public JsonObject toJson() { JsonObject json = new JsonObject(); ListOffsetsResultInfoConverter.toJson(this, json); return json; } @Override public String toString() { return "ListOffsetsResultInfo{" + "offset=" + this.offset + ",timestamp=" + this.timestamp + (this.leaderEpoch != null ? ",leaderEpoch=" + this.leaderEpoch : "") + "}"; } }