org.graylog.freeenterprise.AutoValue_FreeLicenseRequest Maven / Gradle / Ivy
package org.graylog.freeenterprise;
import com.fasterxml.jackson.annotation.JsonProperty;
import javax.annotation.Generated;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_FreeLicenseRequest extends FreeLicenseRequest {
private final @NotBlank String firstName;
private final @NotBlank String lastName;
private final @NotBlank @Email String email;
private final @NotBlank String phone;
private final @NotBlank String company;
private AutoValue_FreeLicenseRequest(
@NotBlank String firstName,
@NotBlank String lastName,
@NotBlank @Email String email,
@NotBlank String phone,
@NotBlank String company) {
this.firstName = firstName;
this.lastName = lastName;
this.email = email;
this.phone = phone;
this.company = company;
}
@JsonProperty("first_name")
@Override
public @NotBlank String firstName() {
return firstName;
}
@JsonProperty("last_name")
@Override
public @NotBlank String lastName() {
return lastName;
}
@JsonProperty("email")
@Override
public @NotBlank @Email String email() {
return email;
}
@JsonProperty("phone")
@Override
public @NotBlank String phone() {
return phone;
}
@JsonProperty("company")
@Override
public @NotBlank String company() {
return company;
}
@Override
public String toString() {
return "FreeLicenseRequest{"
+ "firstName=" + firstName + ", "
+ "lastName=" + lastName + ", "
+ "email=" + email + ", "
+ "phone=" + phone + ", "
+ "company=" + company
+ "}";
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof FreeLicenseRequest) {
FreeLicenseRequest that = (FreeLicenseRequest) o;
return this.firstName.equals(that.firstName())
&& this.lastName.equals(that.lastName())
&& this.email.equals(that.email())
&& this.phone.equals(that.phone())
&& this.company.equals(that.company());
}
return false;
}
@Override
public int hashCode() {
int h$ = 1;
h$ *= 1000003;
h$ ^= firstName.hashCode();
h$ *= 1000003;
h$ ^= lastName.hashCode();
h$ *= 1000003;
h$ ^= email.hashCode();
h$ *= 1000003;
h$ ^= phone.hashCode();
h$ *= 1000003;
h$ ^= company.hashCode();
return h$;
}
static final class Builder extends FreeLicenseRequest.Builder {
private @NotBlank String firstName;
private @NotBlank String lastName;
private @NotBlank @Email String email;
private @NotBlank String phone;
private @NotBlank String company;
Builder() {
}
@Override
public FreeLicenseRequest.Builder firstName(@NotBlank String firstName) {
if (firstName == null) {
throw new NullPointerException("Null firstName");
}
this.firstName = firstName;
return this;
}
@Override
public FreeLicenseRequest.Builder lastName(@NotBlank String lastName) {
if (lastName == null) {
throw new NullPointerException("Null lastName");
}
this.lastName = lastName;
return this;
}
@Override
public FreeLicenseRequest.Builder email(@NotBlank @Email String email) {
if (email == null) {
throw new NullPointerException("Null email");
}
this.email = email;
return this;
}
@Override
public FreeLicenseRequest.Builder phone(@NotBlank String phone) {
if (phone == null) {
throw new NullPointerException("Null phone");
}
this.phone = phone;
return this;
}
@Override
public FreeLicenseRequest.Builder company(@NotBlank String company) {
if (company == null) {
throw new NullPointerException("Null company");
}
this.company = company;
return this;
}
@Override
public FreeLicenseRequest build() {
String missing = "";
if (this.firstName == null) {
missing += " firstName";
}
if (this.lastName == null) {
missing += " lastName";
}
if (this.email == null) {
missing += " email";
}
if (this.phone == null) {
missing += " phone";
}
if (this.company == null) {
missing += " company";
}
if (!missing.isEmpty()) {
throw new IllegalStateException("Missing required properties:" + missing);
}
return new AutoValue_FreeLicenseRequest(
this.firstName,
this.lastName,
this.email,
this.phone,
this.company);
}
}
}