io.honnix.rkt.launcher.options.FetchOptionsBuilder Maven / Gradle / Ivy
package io.honnix.rkt.launcher.options;
import io.honnix.rkt.launcher.model.PullPolicy;
import io.norberg.automatter.AutoMatter;
import java.util.Optional;
import javax.annotation.Generated;
@Generated("io.norberg.automatter.processor.AutoMatterProcessor")
public final class FetchOptionsBuilder {
private Optional full;
private Optional pullPolicy;
private Optional signature;
public FetchOptionsBuilder() {
this.full = Optional.empty();
this.pullPolicy = Optional.empty();
this.signature = Optional.empty();
}
private FetchOptionsBuilder(FetchOptions v) {
this.full = v.full();
this.pullPolicy = v.pullPolicy();
this.signature = v.signature();
}
private FetchOptionsBuilder(FetchOptionsBuilder v) {
this.full = v.full;
this.pullPolicy = v.pullPolicy;
this.signature = v.signature;
}
public Optional full() {
return full;
}
public FetchOptionsBuilder full(Boolean full) {
return full(Optional.ofNullable(full));
}
@SuppressWarnings("unchecked")
public FetchOptionsBuilder full(Optional extends Boolean> full) {
if (full == null) {
throw new NullPointerException("full");
}
this.full = (Optional)full;
return this;
}
public Optional pullPolicy() {
return pullPolicy;
}
public FetchOptionsBuilder pullPolicy(PullPolicy pullPolicy) {
return pullPolicy(Optional.ofNullable(pullPolicy));
}
@SuppressWarnings("unchecked")
public FetchOptionsBuilder pullPolicy(Optional extends PullPolicy> pullPolicy) {
if (pullPolicy == null) {
throw new NullPointerException("pullPolicy");
}
this.pullPolicy = (Optional)pullPolicy;
return this;
}
public Optional signature() {
return signature;
}
public FetchOptionsBuilder signature(String signature) {
return signature(Optional.ofNullable(signature));
}
@SuppressWarnings("unchecked")
public FetchOptionsBuilder signature(Optional extends String> signature) {
if (signature == null) {
throw new NullPointerException("signature");
}
this.signature = (Optional)signature;
return this;
}
public FetchOptions build() {
return new Value(full, pullPolicy, signature);
}
public static FetchOptionsBuilder from(FetchOptions v) {
return new FetchOptionsBuilder(v);
}
public static FetchOptionsBuilder from(FetchOptionsBuilder v) {
return new FetchOptionsBuilder(v);
}
private static final class Value implements FetchOptions {
private final Optional full;
private final Optional pullPolicy;
private final Optional signature;
private Value(@AutoMatter.Field("full") Optional full, @AutoMatter.Field("pullPolicy") Optional pullPolicy, @AutoMatter.Field("signature") Optional signature) {
if (full == null) {
throw new NullPointerException("full");
}
if (pullPolicy == null) {
throw new NullPointerException("pullPolicy");
}
if (signature == null) {
throw new NullPointerException("signature");
}
this.full = full;
this.pullPolicy = pullPolicy;
this.signature = signature;
}
@AutoMatter.Field
@Override
public Optional full() {
return full;
}
@AutoMatter.Field
@Override
public Optional pullPolicy() {
return pullPolicy;
}
@AutoMatter.Field
@Override
public Optional signature() {
return signature;
}
public FetchOptionsBuilder builder() {
return new FetchOptionsBuilder(this);
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof FetchOptions)) {
return false;
}
final FetchOptions that = (FetchOptions) o;
if (full != null ? !full.equals(that.full()) : that.full() != null) {
return false;
}
if (pullPolicy != null ? !pullPolicy.equals(that.pullPolicy()) : that.pullPolicy() != null) {
return false;
}
if (signature != null ? !signature.equals(that.signature()) : that.signature() != null) {
return false;
}
return true;
}
@Override
public int hashCode() {
int result = 1;
long temp;
result = 31 * result + (full != null ? full.hashCode() : 0);
result = 31 * result + (pullPolicy != null ? pullPolicy.hashCode() : 0);
result = 31 * result + (signature != null ? signature.hashCode() : 0);
return result;
}
@Override
public String toString() {
return "FetchOptions{" +
"full=" + full +
", pullPolicy=" + pullPolicy +
", signature=" + signature +
'}';
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy