io.fabric8.kubernetes.api.model.storage.VolumeAttachmentStatusFluentImpl Maven / Gradle / Ivy
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 java.lang.Deprecated;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import java.lang.Object;
import java.lang.Boolean;
import java.util.Map;
/**
* Generated
*/
@SuppressWarnings(value = "unchecked")
public class VolumeAttachmentStatusFluentImpl> extends BaseFluent implements VolumeAttachmentStatusFluent{
public VolumeAttachmentStatusFluentImpl() {
}
public VolumeAttachmentStatusFluentImpl(VolumeAttachmentStatus instance) {
this.withAttachError(instance.getAttachError());
this.withAttached(instance.getAttached());
this.withAttachmentMetadata(instance.getAttachmentMetadata());
this.withDetachError(instance.getDetachError());
this.withAdditionalProperties(instance.getAdditionalProperties());
}
private VolumeErrorBuilder attachError;
private Boolean attached;
private Map attachmentMetadata;
private VolumeErrorBuilder detachError;
private Map additionalProperties;
/**
* This method has been deprecated, please use method buildAttachError instead.
* @return The buildable object.
*/
@Deprecated
public VolumeError getAttachError() {
return this.attachError!=null ?this.attachError.build():null;
}
public VolumeError buildAttachError() {
return this.attachError!=null ?this.attachError.build():null;
}
public A withAttachError(VolumeError attachError) {
_visitables.get("attachError").remove(this.attachError);
if (attachError!=null){ this.attachError= new VolumeErrorBuilder(attachError); _visitables.get("attachError").add(this.attachError);} else { this.attachError = null; _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 VolumeAttachmentStatusFluent.AttachErrorNested withNewAttachError() {
return new VolumeAttachmentStatusFluentImpl.AttachErrorNestedImpl();
}
public VolumeAttachmentStatusFluent.AttachErrorNested withNewAttachErrorLike(VolumeError item) {
return new VolumeAttachmentStatusFluentImpl.AttachErrorNestedImpl(item);
}
public VolumeAttachmentStatusFluent.AttachErrorNested editAttachError() {
return withNewAttachErrorLike(getAttachError());
}
public VolumeAttachmentStatusFluent.AttachErrorNested editOrNewAttachError() {
return withNewAttachErrorLike(getAttachError() != null ? getAttachError(): new VolumeErrorBuilder().build());
}
public VolumeAttachmentStatusFluent.AttachErrorNested editOrNewAttachErrorLike(VolumeError item) {
return withNewAttachErrorLike(getAttachError() != null ? getAttachError(): 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;
}
/**
* This method has been deprecated, please use method buildDetachError instead.
* @return The buildable object.
*/
@Deprecated
public VolumeError getDetachError() {
return this.detachError!=null ?this.detachError.build():null;
}
public VolumeError buildDetachError() {
return this.detachError!=null ?this.detachError.build():null;
}
public A withDetachError(VolumeError detachError) {
_visitables.get("detachError").remove(this.detachError);
if (detachError!=null){ this.detachError= new VolumeErrorBuilder(detachError); _visitables.get("detachError").add(this.detachError);} else { this.detachError = null; _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 VolumeAttachmentStatusFluent.DetachErrorNested withNewDetachError() {
return new VolumeAttachmentStatusFluentImpl.DetachErrorNestedImpl();
}
public VolumeAttachmentStatusFluent.DetachErrorNested withNewDetachErrorLike(VolumeError item) {
return new VolumeAttachmentStatusFluentImpl.DetachErrorNestedImpl(item);
}
public VolumeAttachmentStatusFluent.DetachErrorNested editDetachError() {
return withNewDetachErrorLike(getDetachError());
}
public VolumeAttachmentStatusFluent.DetachErrorNested editOrNewDetachError() {
return withNewDetachErrorLike(getDetachError() != null ? getDetachError(): new VolumeErrorBuilder().build());
}
public VolumeAttachmentStatusFluent.DetachErrorNested editOrNewDetachErrorLike(VolumeError item) {
return withNewDetachErrorLike(getDetachError() != null ? getDetachError(): 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;
VolumeAttachmentStatusFluentImpl that = (VolumeAttachmentStatusFluentImpl) o;
if (attachError != null ? !attachError.equals(that.attachError) :that.attachError != null) return false;
if (attached != null ? !attached.equals(that.attached) :that.attached != null) return false;
if (attachmentMetadata != null ? !attachmentMetadata.equals(that.attachmentMetadata) :that.attachmentMetadata != null) return false;
if (detachError != null ? !detachError.equals(that.detachError) :that.detachError != null) return false;
if (additionalProperties != null ? !additionalProperties.equals(that.additionalProperties) :that.additionalProperties != null) 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);
}
class AttachErrorNestedImpl extends VolumeErrorFluentImpl> implements VolumeAttachmentStatusFluent.AttachErrorNested,Nested{
AttachErrorNestedImpl(VolumeError item) {
this.builder = new VolumeErrorBuilder(this, item);
}
AttachErrorNestedImpl() {
this.builder = new VolumeErrorBuilder(this);
}
VolumeErrorBuilder builder;
public N and() {
return (N) VolumeAttachmentStatusFluentImpl.this.withAttachError(builder.build());
}
public N endAttachError() {
return and();
}
}
class DetachErrorNestedImpl extends VolumeErrorFluentImpl> implements VolumeAttachmentStatusFluent.DetachErrorNested,Nested{
DetachErrorNestedImpl(VolumeError item) {
this.builder = new VolumeErrorBuilder(this, item);
}
DetachErrorNestedImpl() {
this.builder = new VolumeErrorBuilder(this);
}
VolumeErrorBuilder builder;
public N and() {
return (N) VolumeAttachmentStatusFluentImpl.this.withDetachError(builder.build());
}
public N endDetachError() {
return and();
}
}
} © 2015 - 2025 Weber Informatics LLC | Privacy Policy