io.fabric8.openshift.api.model.installer.gcp.v1.EncryptionKeyReferenceFluent Maven / Gradle / Ivy
The newest version!
package io.fabric8.openshift.api.model.installer.gcp.v1;
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.util.Map;
/**
* Generated
*/
@SuppressWarnings("unchecked")
public class EncryptionKeyReferenceFluent> extends BaseFluent{
public EncryptionKeyReferenceFluent() {
}
public EncryptionKeyReferenceFluent(EncryptionKeyReference instance) {
this.copyInstance(instance);
}
private KMSKeyReferenceBuilder kmsKey;
private String kmsKeyServiceAccount;
private Map additionalProperties;
protected void copyInstance(EncryptionKeyReference instance) {
instance = (instance != null ? instance : new EncryptionKeyReference());
if (instance != null) {
this.withKmsKey(instance.getKmsKey());
this.withKmsKeyServiceAccount(instance.getKmsKeyServiceAccount());
this.withAdditionalProperties(instance.getAdditionalProperties());
}
}
public KMSKeyReference buildKmsKey() {
return this.kmsKey != null ? this.kmsKey.build() : null;
}
public A withKmsKey(KMSKeyReference kmsKey) {
this._visitables.remove("kmsKey");
if (kmsKey != null) {
this.kmsKey = new KMSKeyReferenceBuilder(kmsKey);
this._visitables.get("kmsKey").add(this.kmsKey);
} else {
this.kmsKey = null;
this._visitables.get("kmsKey").remove(this.kmsKey);
}
return (A) this;
}
public boolean hasKmsKey() {
return this.kmsKey != null;
}
public A withNewKmsKey(String keyRing,String location,String name,String projectID) {
return (A)withKmsKey(new KMSKeyReference(keyRing, location, name, projectID));
}
public KmsKeyNested withNewKmsKey() {
return new KmsKeyNested(null);
}
public KmsKeyNested withNewKmsKeyLike(KMSKeyReference item) {
return new KmsKeyNested(item);
}
public KmsKeyNested editKmsKey() {
return withNewKmsKeyLike(java.util.Optional.ofNullable(buildKmsKey()).orElse(null));
}
public KmsKeyNested editOrNewKmsKey() {
return withNewKmsKeyLike(java.util.Optional.ofNullable(buildKmsKey()).orElse(new KMSKeyReferenceBuilder().build()));
}
public KmsKeyNested editOrNewKmsKeyLike(KMSKeyReference item) {
return withNewKmsKeyLike(java.util.Optional.ofNullable(buildKmsKey()).orElse(item));
}
public String getKmsKeyServiceAccount() {
return this.kmsKeyServiceAccount;
}
public A withKmsKeyServiceAccount(String kmsKeyServiceAccount) {
this.kmsKeyServiceAccount = kmsKeyServiceAccount;
return (A) this;
}
public boolean hasKmsKeyServiceAccount() {
return this.kmsKeyServiceAccount != null;
}
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;
EncryptionKeyReferenceFluent that = (EncryptionKeyReferenceFluent) o;
if (!java.util.Objects.equals(kmsKey, that.kmsKey)) return false;
if (!java.util.Objects.equals(kmsKeyServiceAccount, that.kmsKeyServiceAccount)) return false;
if (!java.util.Objects.equals(additionalProperties, that.additionalProperties)) return false;
return true;
}
public int hashCode() {
return java.util.Objects.hash(kmsKey, kmsKeyServiceAccount, additionalProperties, super.hashCode());
}
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (kmsKey != null) { sb.append("kmsKey:"); sb.append(kmsKey + ","); }
if (kmsKeyServiceAccount != null) { sb.append("kmsKeyServiceAccount:"); sb.append(kmsKeyServiceAccount + ","); }
if (additionalProperties != null && !additionalProperties.isEmpty()) { sb.append("additionalProperties:"); sb.append(additionalProperties); }
sb.append("}");
return sb.toString();
}
public class KmsKeyNested extends KMSKeyReferenceFluent> implements Nested{
KmsKeyNested(KMSKeyReference item) {
this.builder = new KMSKeyReferenceBuilder(this, item);
}
KMSKeyReferenceBuilder builder;
public N and() {
return (N) EncryptionKeyReferenceFluent.this.withKmsKey(builder.build());
}
public N endKmsKey() {
return and();
}
}
} © 2015 - 2025 Weber Informatics LLC | Privacy Policy