io.github.microcks.operator.api.base.v1alpha1.PostmanRuntimeSpecFluent Maven / Gradle / Ivy
package io.github.microcks.operator.api.base.v1alpha1;
import io.github.microcks.operator.api.model.ImageSpecBuilder;
import java.lang.SuppressWarnings;
import io.github.microcks.operator.api.model.ImageSpecFluent;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import io.fabric8.kubernetes.api.builder.Nested;
import java.lang.Object;
import java.lang.String;
import io.github.microcks.operator.api.model.ImageSpec;
/**
* Generated
*/
@SuppressWarnings("unchecked")
public class PostmanRuntimeSpecFluent> extends BaseFluent{
public PostmanRuntimeSpecFluent() {
}
public PostmanRuntimeSpecFluent(PostmanRuntimeSpec instance) {
this.copyInstance(instance);
}
private ImageSpecBuilder image;
private int replicas;
protected void copyInstance(PostmanRuntimeSpec instance) {
instance = (instance != null ? instance : new PostmanRuntimeSpec());
if (instance != null) {
this.withImage(instance.getImage());
this.withReplicas(instance.getReplicas());
}
}
public ImageSpec buildImage() {
return this.image != null ? this.image.build() : null;
}
public A withImage(ImageSpec image) {
this._visitables.remove("image");
if (image != null) {
this.image = new ImageSpecBuilder(image);
this._visitables.get("image").add(this.image);
} else {
this.image = null;
this._visitables.get("image").remove(this.image);
}
return (A) this;
}
public boolean hasImage() {
return this.image != null;
}
public ImageNested withNewImage() {
return new ImageNested(null);
}
public ImageNested withNewImageLike(ImageSpec item) {
return new ImageNested(item);
}
public ImageNested editImage() {
return withNewImageLike(java.util.Optional.ofNullable(buildImage()).orElse(null));
}
public ImageNested editOrNewImage() {
return withNewImageLike(java.util.Optional.ofNullable(buildImage()).orElse(new ImageSpecBuilder().build()));
}
public ImageNested editOrNewImageLike(ImageSpec item) {
return withNewImageLike(java.util.Optional.ofNullable(buildImage()).orElse(item));
}
public int getReplicas() {
return this.replicas;
}
public A withReplicas(int replicas) {
this.replicas = replicas;
return (A) this;
}
public boolean hasReplicas() {
return true;
}
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
PostmanRuntimeSpecFluent that = (PostmanRuntimeSpecFluent) o;
if (!java.util.Objects.equals(image, that.image)) return false;
if (replicas != that.replicas) return false;
return true;
}
public int hashCode() {
return java.util.Objects.hash(image, replicas, super.hashCode());
}
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (image != null) { sb.append("image:"); sb.append(image + ","); }
sb.append("replicas:"); sb.append(replicas);
sb.append("}");
return sb.toString();
}
public class ImageNested extends ImageSpecFluent> implements Nested{
ImageNested(ImageSpec item) {
this.builder = new ImageSpecBuilder(this, item);
}
ImageSpecBuilder builder;
public N and() {
return (N) PostmanRuntimeSpecFluent.this.withImage(builder.build());
}
public N endImage() {
return and();
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy