com.networknt.kafka.producer.SerializedKeyAndValue Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kafka-producer Show documentation
Show all versions of kafka-producer Show documentation
A module to push events to a Kafka topic.
package com.networknt.kafka.producer;
import com.google.protobuf.ByteString;
import java.util.Objects;
import java.util.Optional;
public class SerializedKeyAndValue {
Optional partitionId;
Optional traceabilityId;
Optional correlationId;
Optional key;
Optional value;
public SerializedKeyAndValue(Optional partitionId, Optional traceabilityId, Optional correlationId, Optional key, Optional value) {
this.partitionId = partitionId;
this.traceabilityId = traceabilityId;
this.correlationId = correlationId;
this.key = key;
this.value = value;
}
public static SerializedKeyAndValue create(
Optional partitionId, Optional traceabilityId, Optional correlationId, Optional key, Optional value) {
return new SerializedKeyAndValue(partitionId, traceabilityId, correlationId, key, value);
}
public Optional getPartitionId() {
return partitionId;
}
public void setPartitionId(Optional partitionId) {
this.partitionId = partitionId;
}
public Optional getTraceabilityId() {
return traceabilityId;
}
public void setTraceabilityId(Optional traceabilityId) {
this.traceabilityId = traceabilityId;
}
public Optional getCorrelationId() {
return correlationId;
}
public void setCorrelationId(Optional correlationId) {
this.correlationId = correlationId;
}
public Optional getKey() {
return key;
}
public void setKey(Optional key) {
this.key = key;
}
public Optional getValue() {
return value;
}
public void setValue(Optional value) {
this.value = value;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
SerializedKeyAndValue that = (SerializedKeyAndValue) o;
return Objects.equals(partitionId, that.partitionId) && Objects.equals(traceabilityId, that.traceabilityId) && Objects.equals(correlationId, that.correlationId) && Objects.equals(key, that.key) && Objects.equals(value, that.value);
}
@Override
public int hashCode() {
return Objects.hash(partitionId, traceabilityId, correlationId, key, value);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy