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

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

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

class AvroMessageContentUnwrapperResult {

    private final UnwrappedMessageContent content;
    private final AvroMessageContentUnwrapperResultStatus status;

    private AvroMessageContentUnwrapperResult(UnwrappedMessageContent content,
                                              AvroMessageContentUnwrapperResultStatus status) {
        this.content = content;
        this.status = status;
    }

    public static AvroMessageContentUnwrapperResult success(UnwrappedMessageContent content) {
        return new AvroMessageContentUnwrapperResult(content, AvroMessageContentUnwrapperResultStatus.SUCCESS);
    }

    public static AvroMessageContentUnwrapperResult failure() {
        return new AvroMessageContentUnwrapperResult(null, AvroMessageContentUnwrapperResultStatus.FAILURE);
    }

    public UnwrappedMessageContent getContent() {
        return content;
    }

    public AvroMessageContentUnwrapperResultStatus getStatus() {
        return status;
    }

    enum AvroMessageContentUnwrapperResultStatus {
        SUCCESS, FAILURE
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy