pl.allegro.tech.hermes.common.kafka.KafkaTopicName Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hermes-common Show documentation
Show all versions of hermes-common Show documentation
Fast and reliable message broker built on top of Kafka.
The newest version!
package pl.allegro.tech.hermes.common.kafka;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonGetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Objects;
import static com.google.common.base.Preconditions.checkNotNull;
public class KafkaTopicName {
private final String value;
private KafkaTopicName(String value) {
this.value = checkNotNull(value);
}
@JsonCreator
public static KafkaTopicName valueOf(@JsonProperty("value") String value) {
return new KafkaTopicName(value);
}
@JsonGetter(value = "value")
public String asString() {
return value;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
KafkaTopicName that = (KafkaTopicName) o;
return Objects.equals(value, that.value);
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public String toString() {
return "KafkaTopicName(" + value + ")";
}
}