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

zipkin.reporter.kafka08.AutoValue_KafkaSender Maven / Gradle / Ivy

There is a newer version: 1.1.2
Show newest version

package zipkin.reporter.kafka08;

import java.util.Properties;
import javax.annotation.Generated;
import zipkin.reporter.BytesMessageEncoder;
import zipkin.reporter.Encoding;

@Generated("com.google.auto.value.processor.AutoValueProcessor")
 final class AutoValue_KafkaSender extends KafkaSender {

  private final Encoding encoding;
  private final int messageMaxBytes;
  private final BytesMessageEncoder encoder;
  private final String topic;
  private final Properties properties;

  private AutoValue_KafkaSender(
      Encoding encoding,
      int messageMaxBytes,
      BytesMessageEncoder encoder,
      String topic,
      Properties properties) {
    this.encoding = encoding;
    this.messageMaxBytes = messageMaxBytes;
    this.encoder = encoder;
    this.topic = topic;
    this.properties = properties;
  }

  @Override
  public Encoding encoding() {
    return encoding;
  }

  @Override
  public int messageMaxBytes() {
    return messageMaxBytes;
  }

  @Override
  BytesMessageEncoder encoder() {
    return encoder;
  }

  @Override
  String topic() {
    return topic;
  }

  @Override
  Properties properties() {
    return properties;
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof KafkaSender) {
      KafkaSender that = (KafkaSender) o;
      return (this.encoding.equals(that.encoding()))
           && (this.messageMaxBytes == that.messageMaxBytes())
           && (this.encoder.equals(that.encoder()))
           && (this.topic.equals(that.topic()))
           && (this.properties.equals(that.properties()));
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h = 1;
    h *= 1000003;
    h ^= this.encoding.hashCode();
    h *= 1000003;
    h ^= this.messageMaxBytes;
    h *= 1000003;
    h ^= this.encoder.hashCode();
    h *= 1000003;
    h ^= this.topic.hashCode();
    h *= 1000003;
    h ^= this.properties.hashCode();
    return h;
  }

  @Override
  public KafkaSender.Builder toBuilder() {
    return new Builder(this);
  }

  static final class Builder extends KafkaSender.Builder {
    private Encoding encoding;
    private Integer messageMaxBytes;
    private BytesMessageEncoder encoder;
    private String topic;
    private Properties properties;
    Builder() {
    }
    private Builder(KafkaSender source) {
      this.encoding = source.encoding();
      this.messageMaxBytes = source.messageMaxBytes();
      this.encoder = source.encoder();
      this.topic = source.topic();
      this.properties = source.properties();
    }
    @Override
    public KafkaSender.Builder encoding(Encoding encoding) {
      if (encoding == null) {
        throw new NullPointerException("Null encoding");
      }
      this.encoding = encoding;
      return this;
    }
    @Override
    Encoding encoding() {
      if (encoding == null) {
        throw new IllegalStateException("Property \"encoding\" has not been set");
      }
      return encoding;
    }
    @Override
    public KafkaSender.Builder messageMaxBytes(int messageMaxBytes) {
      this.messageMaxBytes = messageMaxBytes;
      return this;
    }
    @Override
    KafkaSender.Builder encoder(BytesMessageEncoder encoder) {
      if (encoder == null) {
        throw new NullPointerException("Null encoder");
      }
      this.encoder = encoder;
      return this;
    }
    @Override
    public KafkaSender.Builder topic(String topic) {
      if (topic == null) {
        throw new NullPointerException("Null topic");
      }
      this.topic = topic;
      return this;
    }
    @Override
    KafkaSender.Builder properties(Properties properties) {
      if (properties == null) {
        throw new NullPointerException("Null properties");
      }
      this.properties = properties;
      return this;
    }
    @Override
    Properties properties() {
      if (properties == null) {
        throw new IllegalStateException("Property \"properties\" has not been set");
      }
      return properties;
    }
    @Override
    public KafkaSender autoBuild() {
      String missing = "";
      if (this.encoding == null) {
        missing += " encoding";
      }
      if (this.messageMaxBytes == null) {
        missing += " messageMaxBytes";
      }
      if (this.encoder == null) {
        missing += " encoder";
      }
      if (this.topic == null) {
        missing += " topic";
      }
      if (this.properties == null) {
        missing += " properties";
      }
      if (!missing.isEmpty()) {
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_KafkaSender(
          this.encoding,
          this.messageMaxBytes,
          this.encoder,
          this.topic,
          this.properties);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy