io.dekorate.halkyon.model.CapabilitySpecBuilder Maven / Gradle / Ivy
package io.dekorate.halkyon.model;
import io.dekorate.deps.kubernetes.api.builder.VisitableBuilder;
import java.lang.Object;
import java.lang.Boolean;
public class CapabilitySpecBuilder extends CapabilitySpecFluentImpl implements VisitableBuilder {
CapabilitySpecFluent> fluent;
Boolean validationEnabled;
public CapabilitySpecBuilder() {
this(true);
}
public CapabilitySpecBuilder(Boolean validationEnabled) {
this(new CapabilitySpec(), validationEnabled);
}
public CapabilitySpecBuilder(CapabilitySpecFluent> fluent) {
this(fluent, true);
}
public CapabilitySpecBuilder(CapabilitySpecFluent> fluent,Boolean validationEnabled) {
this(fluent, new CapabilitySpec(), validationEnabled);
}
public CapabilitySpecBuilder(CapabilitySpecFluent> fluent,CapabilitySpec instance) {
this(fluent, instance, true);
}
public CapabilitySpecBuilder(CapabilitySpecFluent> fluent,CapabilitySpec instance,Boolean validationEnabled) {
this.fluent = fluent;
fluent.withCategory(instance.getCategory());
fluent.withType(instance.getType());
fluent.withVersion(instance.getVersion());
fluent.withParameters(instance.getParameters());
fluent.withParametersJson(instance.getParametersJson());
this.validationEnabled = validationEnabled;
}
public CapabilitySpecBuilder(CapabilitySpec instance) {
this(instance,true);
}
public CapabilitySpecBuilder(CapabilitySpec instance,Boolean validationEnabled) {
this.fluent = this;
this.withCategory(instance.getCategory());
this.withType(instance.getType());
this.withVersion(instance.getVersion());
this.withParameters(instance.getParameters());
this.withParametersJson(instance.getParametersJson());
this.validationEnabled = validationEnabled;
}
public CapabilitySpec build() {
CapabilitySpec buildable = new CapabilitySpec(fluent.getCategory(),fluent.getType(),fluent.getVersion(),fluent.getParameters(),fluent.getParametersJson());
return buildable;
}
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
CapabilitySpecBuilder that = (CapabilitySpecBuilder) o;
if (fluent != null &&fluent != this ? !fluent.equals(that.fluent) :that.fluent != null &&fluent != this ) return false;
if (validationEnabled != null ? !validationEnabled.equals(that.validationEnabled) :that.validationEnabled != null) return false;
return true;
}
public int hashCode() {
return java.util.Objects.hash(fluent, validationEnabled, super.hashCode());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy