io.honnix.rkt.launcher.model.ImageBuilder Maven / Gradle / Ivy
package io.honnix.rkt.launcher.model;
import io.norberg.automatter.AutoMatter;
import java.time.Instant;
import javax.annotation.Generated;
@Generated("io.norberg.automatter.processor.AutoMatterProcessor")
public final class ImageBuilder {
private String id;
private String name;
private Instant importTime;
private Instant lastUsedTime;
private int size;
public ImageBuilder() {
}
private ImageBuilder(Image v) {
this.id = v.id();
this.name = v.name();
this.importTime = v.importTime();
this.lastUsedTime = v.lastUsedTime();
this.size = v.size();
}
private ImageBuilder(ImageBuilder v) {
this.id = v.id;
this.name = v.name;
this.importTime = v.importTime;
this.lastUsedTime = v.lastUsedTime;
this.size = v.size;
}
public String id() {
return id;
}
public ImageBuilder id(String id) {
if (id == null) {
throw new NullPointerException("id");
}
this.id = id;
return this;
}
public String name() {
return name;
}
public ImageBuilder name(String name) {
if (name == null) {
throw new NullPointerException("name");
}
this.name = name;
return this;
}
public Instant importTime() {
return importTime;
}
public ImageBuilder importTime(Instant importTime) {
if (importTime == null) {
throw new NullPointerException("importTime");
}
this.importTime = importTime;
return this;
}
public Instant lastUsedTime() {
return lastUsedTime;
}
public ImageBuilder lastUsedTime(Instant lastUsedTime) {
if (lastUsedTime == null) {
throw new NullPointerException("lastUsedTime");
}
this.lastUsedTime = lastUsedTime;
return this;
}
public int size() {
return size;
}
public ImageBuilder size(int size) {
this.size = size;
return this;
}
public Image build() {
return new Value(id, name, importTime, lastUsedTime, size);
}
public static ImageBuilder from(Image v) {
return new ImageBuilder(v);
}
public static ImageBuilder from(ImageBuilder v) {
return new ImageBuilder(v);
}
private static final class Value implements Image {
private final String id;
private final String name;
private final Instant importTime;
private final Instant lastUsedTime;
private final int size;
private Value(@AutoMatter.Field("id") String id, @AutoMatter.Field("name") String name, @AutoMatter.Field("importTime") Instant importTime, @AutoMatter.Field("lastUsedTime") Instant lastUsedTime, @AutoMatter.Field("size") int size) {
if (id == null) {
throw new NullPointerException("id");
}
if (name == null) {
throw new NullPointerException("name");
}
if (importTime == null) {
throw new NullPointerException("importTime");
}
if (lastUsedTime == null) {
throw new NullPointerException("lastUsedTime");
}
this.id = id;
this.name = name;
this.importTime = importTime;
this.lastUsedTime = lastUsedTime;
this.size = size;
}
@AutoMatter.Field
@Override
public String id() {
return id;
}
@AutoMatter.Field
@Override
public String name() {
return name;
}
@AutoMatter.Field
@Override
public Instant importTime() {
return importTime;
}
@AutoMatter.Field
@Override
public Instant lastUsedTime() {
return lastUsedTime;
}
@AutoMatter.Field
@Override
public int size() {
return size;
}
public ImageBuilder builder() {
return new ImageBuilder(this);
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof Image)) {
return false;
}
final Image that = (Image) o;
if (id != null ? !id.equals(that.id()) : that.id() != null) {
return false;
}
if (name != null ? !name.equals(that.name()) : that.name() != null) {
return false;
}
if (importTime != null ? !importTime.equals(that.importTime()) : that.importTime() != null) {
return false;
}
if (lastUsedTime != null ? !lastUsedTime.equals(that.lastUsedTime()) : that.lastUsedTime() != null) {
return false;
}
if (size != that.size()) {
return false;
}
return true;
}
@Override
public int hashCode() {
int result = 1;
long temp;
result = 31 * result + (id != null ? id.hashCode() : 0);
result = 31 * result + (name != null ? name.hashCode() : 0);
result = 31 * result + (importTime != null ? importTime.hashCode() : 0);
result = 31 * result + (lastUsedTime != null ? lastUsedTime.hashCode() : 0);
result = 31 * result + size;
return result;
}
@Override
public String toString() {
return "Image{" +
"id=" + id +
", name=" + name +
", importTime=" + importTime +
", lastUsedTime=" + lastUsedTime +
", size=" + size +
'}';
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy