io.fabric8.kubernetes.api.model.storage.VolumeAttachmentStatusFluent Maven / Gradle / Ivy
The newest version!
package io.fabric8.kubernetes.api.model.storage;
import java.lang.SuppressWarnings;
import io.fabric8.kubernetes.api.builder.Nested;
import java.lang.String;
import java.util.LinkedHashMap;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import java.lang.Object;
import java.lang.Boolean;
import java.util.Map;
/**
* Generated
*/
@SuppressWarnings("unchecked")
public class VolumeAttachmentStatusFluent> extends BaseFluent{
public VolumeAttachmentStatusFluent() {
}
public VolumeAttachmentStatusFluent(VolumeAttachmentStatus instance) {
this.copyInstance(instance);
}
private VolumeErrorBuilder attachError;
private Boolean attached;
private Map attachmentMetadata;
private VolumeErrorBuilder detachError;
private Map additionalProperties;
protected void copyInstance(VolumeAttachmentStatus instance) {
instance = (instance != null ? instance : new VolumeAttachmentStatus());
if (instance != null) {
this.withAttachError(instance.getAttachError());
this.withAttached(instance.getAttached());
this.withAttachmentMetadata(instance.getAttachmentMetadata());
this.withDetachError(instance.getDetachError());
this.withAdditionalProperties(instance.getAdditionalProperties());
}
}
public VolumeError buildAttachError() {
return this.attachError != null ? this.attachError.build() : null;
}
public A withAttachError(VolumeError attachError) {
this._visitables.remove("attachError");
if (attachError != null) {
this.attachError = new VolumeErrorBuilder(attachError);
this._visitables.get("attachError").add(this.attachError);
} else {
this.attachError = null;
this._visitables.get("attachError").remove(this.attachError);
}
return (A) this;
}
public boolean hasAttachError() {
return this.attachError != null;
}
public A withNewAttachError(String message,String time) {
return (A)withAttachError(new VolumeError(message, time));
}
public AttachErrorNested withNewAttachError() {
return new AttachErrorNested(null);
}
public AttachErrorNested withNewAttachErrorLike(VolumeError item) {
return new AttachErrorNested(item);
}
public AttachErrorNested editAttachError() {
return withNewAttachErrorLike(java.util.Optional.ofNullable(buildAttachError()).orElse(null));
}
public AttachErrorNested editOrNewAttachError() {
return withNewAttachErrorLike(java.util.Optional.ofNullable(buildAttachError()).orElse(new VolumeErrorBuilder().build()));
}
public AttachErrorNested editOrNewAttachErrorLike(VolumeError item) {
return withNewAttachErrorLike(java.util.Optional.ofNullable(buildAttachError()).orElse(item));
}
public Boolean getAttached() {
return this.attached;
}
public A withAttached(Boolean attached) {
this.attached = attached;
return (A) this;
}
public boolean hasAttached() {
return this.attached != null;
}
public A addToAttachmentMetadata(String key,String value) {
if(this.attachmentMetadata == null && key != null && value != null) { this.attachmentMetadata = new LinkedHashMap(); }
if(key != null && value != null) {this.attachmentMetadata.put(key, value);} return (A)this;
}
public A addToAttachmentMetadata(Map map) {
if(this.attachmentMetadata == null && map != null) { this.attachmentMetadata = new LinkedHashMap(); }
if(map != null) { this.attachmentMetadata.putAll(map);} return (A)this;
}
public A removeFromAttachmentMetadata(String key) {
if(this.attachmentMetadata == null) { return (A) this; }
if(key != null && this.attachmentMetadata != null) {this.attachmentMetadata.remove(key);} return (A)this;
}
public A removeFromAttachmentMetadata(Map map) {
if(this.attachmentMetadata == null) { return (A) this; }
if(map != null) { for(Object key : map.keySet()) {if (this.attachmentMetadata != null){this.attachmentMetadata.remove(key);}}} return (A)this;
}
public Map getAttachmentMetadata() {
return this.attachmentMetadata;
}
public A withAttachmentMetadata(Map attachmentMetadata) {
if (attachmentMetadata == null) {
this.attachmentMetadata = null;
} else {
this.attachmentMetadata = new LinkedHashMap(attachmentMetadata);
}
return (A) this;
}
public boolean hasAttachmentMetadata() {
return this.attachmentMetadata != null;
}
public VolumeError buildDetachError() {
return this.detachError != null ? this.detachError.build() : null;
}
public A withDetachError(VolumeError detachError) {
this._visitables.remove("detachError");
if (detachError != null) {
this.detachError = new VolumeErrorBuilder(detachError);
this._visitables.get("detachError").add(this.detachError);
} else {
this.detachError = null;
this._visitables.get("detachError").remove(this.detachError);
}
return (A) this;
}
public boolean hasDetachError() {
return this.detachError != null;
}
public A withNewDetachError(String message,String time) {
return (A)withDetachError(new VolumeError(message, time));
}
public DetachErrorNested withNewDetachError() {
return new DetachErrorNested(null);
}
public DetachErrorNested withNewDetachErrorLike(VolumeError item) {
return new DetachErrorNested(item);
}
public DetachErrorNested editDetachError() {
return withNewDetachErrorLike(java.util.Optional.ofNullable(buildDetachError()).orElse(null));
}
public DetachErrorNested editOrNewDetachError() {
return withNewDetachErrorLike(java.util.Optional.ofNullable(buildDetachError()).orElse(new VolumeErrorBuilder().build()));
}
public DetachErrorNested editOrNewDetachErrorLike(VolumeError item) {
return withNewDetachErrorLike(java.util.Optional.ofNullable(buildDetachError()).orElse(item));
}
public A addToAdditionalProperties(String key,Object value) {
if(this.additionalProperties == null && key != null && value != null) { this.additionalProperties = new LinkedHashMap(); }
if(key != null && value != null) {this.additionalProperties.put(key, value);} return (A)this;
}
public A addToAdditionalProperties(Map map) {
if(this.additionalProperties == null && map != null) { this.additionalProperties = new LinkedHashMap(); }
if(map != null) { this.additionalProperties.putAll(map);} return (A)this;
}
public A removeFromAdditionalProperties(String key) {
if(this.additionalProperties == null) { return (A) this; }
if(key != null && this.additionalProperties != null) {this.additionalProperties.remove(key);} return (A)this;
}
public A removeFromAdditionalProperties(Map map) {
if(this.additionalProperties == null) { return (A) this; }
if(map != null) { for(Object key : map.keySet()) {if (this.additionalProperties != null){this.additionalProperties.remove(key);}}} return (A)this;
}
public Map getAdditionalProperties() {
return this.additionalProperties;
}
public A withAdditionalProperties(Map additionalProperties) {
if (additionalProperties == null) {
this.additionalProperties = null;
} else {
this.additionalProperties = new LinkedHashMap(additionalProperties);
}
return (A) this;
}
public boolean hasAdditionalProperties() {
return this.additionalProperties != null;
}
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
VolumeAttachmentStatusFluent that = (VolumeAttachmentStatusFluent) o;
if (!java.util.Objects.equals(attachError, that.attachError)) return false;
if (!java.util.Objects.equals(attached, that.attached)) return false;
if (!java.util.Objects.equals(attachmentMetadata, that.attachmentMetadata)) return false;
if (!java.util.Objects.equals(detachError, that.detachError)) return false;
if (!java.util.Objects.equals(additionalProperties, that.additionalProperties)) return false;
return true;
}
public int hashCode() {
return java.util.Objects.hash(attachError, attached, attachmentMetadata, detachError, additionalProperties, super.hashCode());
}
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (attachError != null) { sb.append("attachError:"); sb.append(attachError + ","); }
if (attached != null) { sb.append("attached:"); sb.append(attached + ","); }
if (attachmentMetadata != null && !attachmentMetadata.isEmpty()) { sb.append("attachmentMetadata:"); sb.append(attachmentMetadata + ","); }
if (detachError != null) { sb.append("detachError:"); sb.append(detachError + ","); }
if (additionalProperties != null && !additionalProperties.isEmpty()) { sb.append("additionalProperties:"); sb.append(additionalProperties); }
sb.append("}");
return sb.toString();
}
public A withAttached() {
return withAttached(true);
}
public class AttachErrorNested extends VolumeErrorFluent> implements Nested{
AttachErrorNested(VolumeError item) {
this.builder = new VolumeErrorBuilder(this, item);
}
VolumeErrorBuilder builder;
public N and() {
return (N) VolumeAttachmentStatusFluent.this.withAttachError(builder.build());
}
public N endAttachError() {
return and();
}
}
public class DetachErrorNested extends VolumeErrorFluent> implements Nested{
DetachErrorNested(VolumeError item) {
this.builder = new VolumeErrorBuilder(this, item);
}
VolumeErrorBuilder builder;
public N and() {
return (N) VolumeAttachmentStatusFluent.this.withDetachError(builder.build());
}
public N endDetachError() {
return and();
}
}
}