All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.fabric8.knative.internal.networking.v1alpha1.ServerlessServiceSpecFluent Maven / Gradle / Ivy

package io.fabric8.knative.internal.networking.v1alpha1;

import java.lang.SuppressWarnings;
import io.fabric8.kubernetes.api.builder.Nested;
import java.lang.String;
import java.lang.Integer;
import io.fabric8.kubernetes.api.model.ObjectReference;
import io.fabric8.kubernetes.api.model.ObjectReferenceFluent;
import io.fabric8.kubernetes.api.model.ObjectReferenceBuilder;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import java.lang.Object;

 /**
  * Generated
  */
  @SuppressWarnings(value = "unchecked")
  public class ServerlessServiceSpecFluent> extends BaseFluent{
  public ServerlessServiceSpecFluent() {
  }
  public ServerlessServiceSpecFluent(ServerlessServiceSpec instance) {
    instance = (instance != null ? instance : new ServerlessServiceSpec());

    if (instance != null) {
      this.withMode(instance.getMode());
      this.withNumActivators(instance.getNumActivators());
      this.withObjectRef(instance.getObjectRef());
      this.withProtocolType(instance.getProtocolType());
      this.withMode(instance.getMode());
      this.withNumActivators(instance.getNumActivators());
      this.withObjectRef(instance.getObjectRef());
      this.withProtocolType(instance.getProtocolType());
    }
  }
  private String mode;
  private Integer numActivators;
  private ObjectReferenceBuilder objectRef;
  private String protocolType;
  public String getMode() {
    return this.mode;
  }
  public A withMode(String mode) {
    this.mode=mode; return (A) this;
  }
  public boolean hasMode() {
    return this.mode != null;
  }
  public Integer getNumActivators() {
    return this.numActivators;
  }
  public A withNumActivators(Integer numActivators) {
    this.numActivators=numActivators; return (A) this;
  }
  public boolean hasNumActivators() {
    return this.numActivators != null;
  }
  public ObjectReference buildObjectRef() {
    return this.objectRef!=null ?this.objectRef.build():null;
  }
  public A withObjectRef(ObjectReference objectRef) {
    _visitables.get("objectRef").remove(this.objectRef);
    if (objectRef!=null){ this.objectRef= new ObjectReferenceBuilder(objectRef); _visitables.get("objectRef").add(this.objectRef);} else { this.objectRef = null; _visitables.get("objectRef").remove(this.objectRef); } return (A) this;
  }
  public boolean hasObjectRef() {
    return this.objectRef != null;
  }
  public ObjectRefNested withNewObjectRef() {
    return new ObjectRefNested(null);
  }
  public ObjectRefNested withNewObjectRefLike(ObjectReference item) {
    return new ObjectRefNested(item);
  }
  public ObjectRefNested editObjectRef() {
    return withNewObjectRefLike(java.util.Optional.ofNullable(buildObjectRef()).orElse(null));
  }
  public ObjectRefNested editOrNewObjectRef() {
    return withNewObjectRefLike(java.util.Optional.ofNullable(buildObjectRef()).orElse(new ObjectReferenceBuilder().build()));
  }
  public ObjectRefNested editOrNewObjectRefLike(ObjectReference item) {
    return withNewObjectRefLike(java.util.Optional.ofNullable(buildObjectRef()).orElse(item));
  }
  public String getProtocolType() {
    return this.protocolType;
  }
  public A withProtocolType(String protocolType) {
    this.protocolType=protocolType; return (A) this;
  }
  public boolean hasProtocolType() {
    return this.protocolType != 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;
    ServerlessServiceSpecFluent that = (ServerlessServiceSpecFluent) o;
    if (!java.util.Objects.equals(mode, that.mode)) return false;

    if (!java.util.Objects.equals(numActivators, that.numActivators)) return false;

    if (!java.util.Objects.equals(objectRef, that.objectRef)) return false;

    if (!java.util.Objects.equals(protocolType, that.protocolType)) return false;

    return true;
  }
  public int hashCode() {
    return java.util.Objects.hash(mode,  numActivators,  objectRef,  protocolType,  super.hashCode());
  }
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("{");
    if (mode != null) { sb.append("mode:"); sb.append(mode + ","); }
    if (numActivators != null) { sb.append("numActivators:"); sb.append(numActivators + ","); }
    if (objectRef != null) { sb.append("objectRef:"); sb.append(objectRef + ","); }
    if (protocolType != null) { sb.append("protocolType:"); sb.append(protocolType); }
    sb.append("}");
    return sb.toString();
  }
  public class ObjectRefNested extends ObjectReferenceFluent> implements Nested{
    ObjectRefNested(ObjectReference item) {
      this.builder = new ObjectReferenceBuilder(this, item);
    }
    ObjectReferenceBuilder builder;
    public N and() {
      return (N) ServerlessServiceSpecFluent.this.withObjectRef(builder.build());
    }
    public N endObjectRef() {
      return and();
    }
    
  }
  
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy