
com.example.PersonValue Maven / Gradle / Ivy
package com.example;
import java.lang.Integer;
import java.lang.Object;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
/**
* Value type PersonValue.
*
* Auto-generated from specification.
*/
public final class PersonValue {
private final Integer id;
private final String name;
/**
* Constructor.
*/
private PersonValue(Integer id, String name) {
this.id = id;
this.name = name;
}
/**
* Factory method for builder.
* @return a new builder for PersonValue
*/
public static Builder builder() {
return new Builder(5, "");
}
/**
* Getter for the property id.
* @return the value of id
*/
public Integer getId() {
return id;
}
/**
* Getter for the property name.
* @return the value of name
*/
public String getName() {
return name;
}
@Override
public String toString() {
return "PersonValue[id=" + id + ", name=" + name + "]";
}
@Override
public int hashCode() {
return Objects.hash(id, name);
}
@Override
public boolean equals(Object other) {
if (other == this) {
return true;
}
else if (other == null || !this.getClass().equals(other.getClass())) {
return false;
}
final PersonValue that = (PersonValue) other;
return this.id.equals(that.id) && this.name.equals(that.name);
}
/**
* The builder for PersonValue.
*/
public static final class Builder {
private Integer id;
private String name;
/**
* Constructor.
*/
private Builder(Integer id, String name) {
this.id = id;
this.name = name;
}
/**
* Method to configure property id on the builder.
* @return a new builder
*/
public Builder id(Integer id) {
this.id = id;
return new Builder(id, name);
}
/**
* Method to configure property name on the builder.
* @return a new builder
*/
public Builder name(String name) {
this.name = name;
return new Builder(id, name);
}
/**
* Build an instance of PersonValue.
* @return a new instance of PersonValue
*/
public PersonValue build() {
Objects.requireNonNull(id);
Objects.requireNonNull(name);
return new PersonValue(id, name);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy