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

org.graylog2.contentpacks.model.entities.references.AutoValue_ValueReference Maven / Gradle / Ivy

There is a newer version: 5.2.7
Show newest version


package org.graylog2.contentpacks.model.entities.references;

import com.fasterxml.jackson.annotation.JsonProperty;
import javax.annotation.Generated;

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

  private final ValueType valueType;

  private final Object value;

  private AutoValue_ValueReference(
      ValueType valueType,
      Object value) {
    this.valueType = valueType;
    this.value = value;
  }

  @JsonProperty(value = "@type")
  @Override
  public ValueType valueType() {
    return valueType;
  }

  @JsonProperty(value = "@value")
  @Override
  public Object value() {
    return value;
  }

  @Override
  public String toString() {
    return "ValueReference{"
         + "valueType=" + valueType + ", "
         + "value=" + value
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof ValueReference) {
      ValueReference that = (ValueReference) o;
      return (this.valueType.equals(that.valueType()))
           && (this.value.equals(that.value()));
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= valueType.hashCode();
    h$ *= 1000003;
    h$ ^= value.hashCode();
    return h$;
  }

  static final class Builder extends ValueReference.Builder {
    private ValueType valueType;
    private Object value;
    Builder() {
    }
    @Override
    public ValueReference.Builder valueType(ValueType valueType) {
      if (valueType == null) {
        throw new NullPointerException("Null valueType");
      }
      this.valueType = valueType;
      return this;
    }
    @Override
    public ValueReference.Builder value(Object value) {
      if (value == null) {
        throw new NullPointerException("Null value");
      }
      this.value = value;
      return this;
    }
    @Override
    ValueReference autoBuild() {
      String missing = "";
      if (this.valueType == null) {
        missing += " valueType";
      }
      if (this.value == null) {
        missing += " value";
      }
      if (!missing.isEmpty()) {
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_ValueReference(
          this.valueType,
          this.value);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy