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

io.norberg.automatter.example.jdk8.BazBuilder Maven / Gradle / Ivy

package io.norberg.automatter.example.jdk8;

import io.norberg.automatter.AutoMatter;
import javax.annotation.Generated;

@Generated("io.norberg.automatter.processor.AutoMatterProcessor")
public final class BazBuilder {
  private String baz;

  public BazBuilder() {
  }

  private BazBuilder(StaticAndDefaultExample.Baz v) {
    this.baz = v.baz();
  }

  private BazBuilder(BazBuilder v) {
    this.baz = v.baz;
  }

  public String baz() {
    return baz;
  }

  public BazBuilder baz(String baz) {
    if (baz == null) {
      throw new NullPointerException("baz");
    }
    this.baz = baz;
    return this;
  }

  public StaticAndDefaultExample.Baz build() {
    return new Value(baz);
  }

  public static BazBuilder from(StaticAndDefaultExample.Baz v) {
    return new BazBuilder(v);
  }

  public static BazBuilder from(BazBuilder v) {
    return new BazBuilder(v);
  }

  private static final class Value implements StaticAndDefaultExample.Baz {
    private final String baz;

    private Value(@AutoMatter.Field("baz") String baz) {
      if (baz == null) {
        throw new NullPointerException("baz");
      }
      this.baz = baz;
    }

    @AutoMatter.Field
    @Override
    public String baz() {
      return baz;
    }

    public BazBuilder builder() {
      return new BazBuilder(this);
    }

    @Override
    public boolean equals(Object o) {
      if (this == o) {
        return true;
      }
      if (!(o instanceof StaticAndDefaultExample.Baz)) {
        return false;
      }
      final StaticAndDefaultExample.Baz that = (StaticAndDefaultExample.Baz) o;
      if (baz != null ? !baz.equals(that.baz()) : that.baz() != null) {
        return false;
      }
      return true;
    }

    @Override
    public int hashCode() {
      int result = 1;
      long temp;
      result = 31 * result + (baz != null ? baz.hashCode() : 0);
      return result;
    }

    @Override
    public String toString() {
      return "StaticAndDefaultExample.Baz{" +
      "baz=" + baz +
      '}';
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy