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

pl.allegro.tech.hermes.common.message.wrapper.UnwrappedMessageContent Maven / Gradle / Ivy

There is a newer version: 2.6.21
Show newest version
package pl.allegro.tech.hermes.common.message.wrapper;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.apache.avro.Schema;
import pl.allegro.tech.hermes.schema.CompiledSchema;

import java.util.Optional;

@SuppressFBWarnings("EI_EXPOSE_REP2")
public class UnwrappedMessageContent {

    private final MessageMetadata messageMetadata;
    private final byte[] content;
    private final Optional> schema;

    public UnwrappedMessageContent(MessageMetadata messageMetadata, byte[] content) {
        this.messageMetadata = messageMetadata;
        this.content = content;
        this.schema = Optional.empty();
    }

    public UnwrappedMessageContent(MessageMetadata messageMetadata, byte[] content, CompiledSchema schema) {
        this.messageMetadata = messageMetadata;
        this.content = content;
        this.schema = Optional.of(schema);
    }

    public byte[] getContent() {
        return content;
    }

    public MessageMetadata getMessageMetadata() {
        return messageMetadata;
    }

    public Optional> getSchema() {
        return schema;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy