All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.networknt.kafka.producer.SerializedKeyAndValue Maven / Gradle / Ivy

There is a newer version: 2.1.37
Show newest version
package com.networknt.kafka.producer;

import com.google.protobuf.ByteString;

import java.util.Map;
import java.util.Objects;
import java.util.Optional;

public class SerializedKeyAndValue {
    Optional partitionId;
    Optional traceabilityId;
    Optional correlationId;
    Optional key;
    Optional value;
    Optional> headers;
    Optional timestamp;

    public SerializedKeyAndValue(Optional partitionId, Optional traceabilityId, Optional correlationId, Optional key, Optional value,Optional> headers, Optional timestamp) {
        this.partitionId = partitionId;
        this.traceabilityId = traceabilityId;
        this.correlationId = correlationId;
        this.key = key;
        this.value = value;
        this.headers= headers;
        this.timestamp= timestamp;
    }

    public static SerializedKeyAndValue create(
            Optional partitionId, Optional traceabilityId, Optional correlationId, Optional key, Optional value, Optional> headers, Optional timestamp) {
        return new SerializedKeyAndValue(partitionId, traceabilityId, correlationId, key, value, headers,timestamp);
    }

    public Optional getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(Optional timestamp) {
        this.timestamp = timestamp;
    }
    public Optional> getHeaders() {
        return headers;
    }

    public void setHeaders(Optional> headers) {
        this.headers = headers;
    }
    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) && Objects.equals(headers, that.headers) && Objects.equals(timestamp, that.timestamp);
    }

    @Override
    public int hashCode() {
        return Objects.hash(partitionId, traceabilityId, correlationId, key, value, headers, timestamp);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy