org.openmetadata.schema.entity.events.EventSubscriptionOffset Maven / Gradle / Ivy
package org.openmetadata.schema.entity.events;
import javax.annotation.processing.Generated;
import javax.validation.constraints.NotNull;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
/**
* EventSubscriptionOffset
*
* Represents the offsets for an event subscription, tracking the starting point and current position of events processed.
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"startingOffset",
"currentOffset",
"timestamp"
})
@Generated("jsonschema2pojo")
public class EventSubscriptionOffset {
/**
* The offset from where event processing starts.
* (Required)
*
*/
@JsonProperty("startingOffset")
@JsonPropertyDescription("The offset from where event processing starts.")
@NotNull
private Long startingOffset;
/**
* The current position in the events.
* (Required)
*
*/
@JsonProperty("currentOffset")
@JsonPropertyDescription("The current position in the events.")
@NotNull
private Long currentOffset;
/**
* Timestamp in Unix epoch time milliseconds.@om-field-type
*
*/
@JsonProperty("timestamp")
@JsonPropertyDescription("Timestamp in Unix epoch time milliseconds.")
private java.lang.Long timestamp;
/**
* The offset from where event processing starts.
* (Required)
*
*/
@JsonProperty("startingOffset")
public Long getStartingOffset() {
return startingOffset;
}
/**
* The offset from where event processing starts.
* (Required)
*
*/
@JsonProperty("startingOffset")
public void setStartingOffset(Long startingOffset) {
this.startingOffset = startingOffset;
}
public EventSubscriptionOffset withStartingOffset(Long startingOffset) {
this.startingOffset = startingOffset;
return this;
}
/**
* The current position in the events.
* (Required)
*
*/
@JsonProperty("currentOffset")
public Long getCurrentOffset() {
return currentOffset;
}
/**
* The current position in the events.
* (Required)
*
*/
@JsonProperty("currentOffset")
public void setCurrentOffset(Long currentOffset) {
this.currentOffset = currentOffset;
}
public EventSubscriptionOffset withCurrentOffset(Long currentOffset) {
this.currentOffset = currentOffset;
return this;
}
/**
* Timestamp in Unix epoch time milliseconds.@om-field-type
*
*/
@JsonProperty("timestamp")
public java.lang.Long getTimestamp() {
return timestamp;
}
/**
* Timestamp in Unix epoch time milliseconds.@om-field-type
*
*/
@JsonProperty("timestamp")
public void setTimestamp(java.lang.Long timestamp) {
this.timestamp = timestamp;
}
public EventSubscriptionOffset withTimestamp(java.lang.Long timestamp) {
this.timestamp = timestamp;
return this;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(EventSubscriptionOffset.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
sb.append("startingOffset");
sb.append('=');
sb.append(((this.startingOffset == null)?"":this.startingOffset));
sb.append(',');
sb.append("currentOffset");
sb.append('=');
sb.append(((this.currentOffset == null)?"":this.currentOffset));
sb.append(',');
sb.append("timestamp");
sb.append('=');
sb.append(((this.timestamp == null)?"":this.timestamp));
sb.append(',');
if (sb.charAt((sb.length()- 1)) == ',') {
sb.setCharAt((sb.length()- 1), ']');
} else {
sb.append(']');
}
return sb.toString();
}
@Override
public int hashCode() {
int result = 1;
result = ((result* 31)+((this.startingOffset == null)? 0 :this.startingOffset.hashCode()));
result = ((result* 31)+((this.currentOffset == null)? 0 :this.currentOffset.hashCode()));
result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode()));
return result;
}
@Override
public boolean equals(Object other) {
if (other == this) {
return true;
}
if ((other instanceof EventSubscriptionOffset) == false) {
return false;
}
EventSubscriptionOffset rhs = ((EventSubscriptionOffset) other);
return ((((this.startingOffset == rhs.startingOffset)||((this.startingOffset!= null)&&this.startingOffset.equals(rhs.startingOffset)))&&((this.currentOffset == rhs.currentOffset)||((this.currentOffset!= null)&&this.currentOffset.equals(rhs.currentOffset))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp))));
}
}