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

pl.allegro.tech.hermes.api.OwnerId Maven / Gradle / Ivy

There is a newer version: 2.6.22
Show newest version
package pl.allegro.tech.hermes.api;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import jakarta.validation.constraints.NotNull;

import java.util.Objects;

public final class OwnerId {

    @NotNull
    private final String source;

    @NotNull
    private final String id;

    @JsonCreator
    public OwnerId(@JsonProperty("source") String source,
                   @JsonProperty("id") String id) {
        this.source = source;
        this.id = id;
    }

    public String getSource() {
        return source;
    }

    public String getId() {
        return id;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        OwnerId that = (OwnerId) o;
        return Objects.equals(source, that.source)
                && Objects.equals(id, that.id);
    }

    @Override
    public int hashCode() {
        return Objects.hash(source, id);
    }

    @Override
    public String toString() {
        return "OwnerId{"
                + "source='" + source + '\''
                + ", id='" + id + '\''
                + '}';
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy