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

annotations.io.alauda.kubernetes.api.model.LifecycleFluentImpl Maven / Gradle / Ivy

There is a newer version: 0.2.12
Show newest version
package io.alauda.kubernetes.api.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.alauda.kubernetes.api.builder.Nested;
import java.lang.Deprecated;
import javax.validation.Valid;
import io.alauda.kubernetes.api.builder.BaseFluent;
import java.lang.Object;
import java.lang.Boolean;

public class LifecycleFluentImpl> extends io.alauda.kubernetes.api.builder.BaseFluent implements LifecycleFluent{

    private HandlerBuilder postStart;
    private HandlerBuilder preStop;

    public LifecycleFluentImpl(){
    }
    public LifecycleFluentImpl(Lifecycle instance){
            this.withPostStart(instance.getPostStart()); 
            this.withPreStop(instance.getPreStop()); 
    }

    
/**
 * This method has been deprecated, please use method buildPostStart instead.
 */
@Deprecated public Handler getPostStart(){
            return this.postStart!=null?this.postStart.build():null;
    }

    public Handler buildPostStart(){
            return this.postStart!=null?this.postStart.build():null;
    }

    public A withPostStart(Handler postStart){
            _visitables.remove(this.postStart);
            if (postStart!=null){ this.postStart= new HandlerBuilder(postStart); _visitables.add(this.postStart);} return (A) this;
    }

    public Boolean hasPostStart(){
            return this.postStart!=null;
    }

    public LifecycleFluent.PostStartNested withNewPostStart(){
            return new PostStartNestedImpl();
    }

    public LifecycleFluent.PostStartNested withNewPostStartLike(Handler item){
            return new PostStartNestedImpl(item);
    }

    public LifecycleFluent.PostStartNested editPostStart(){
            return withNewPostStartLike(getPostStart());
    }

    public LifecycleFluent.PostStartNested editOrNewPostStart(){
            return withNewPostStartLike(getPostStart() != null ? getPostStart(): new HandlerBuilder().build());
    }

    public LifecycleFluent.PostStartNested editOrNewPostStartLike(Handler item){
            return withNewPostStartLike(getPostStart() != null ? getPostStart(): item);
    }

    
/**
 * This method has been deprecated, please use method buildPreStop instead.
 */
@Deprecated public Handler getPreStop(){
            return this.preStop!=null?this.preStop.build():null;
    }

    public Handler buildPreStop(){
            return this.preStop!=null?this.preStop.build():null;
    }

    public A withPreStop(Handler preStop){
            _visitables.remove(this.preStop);
            if (preStop!=null){ this.preStop= new HandlerBuilder(preStop); _visitables.add(this.preStop);} return (A) this;
    }

    public Boolean hasPreStop(){
            return this.preStop!=null;
    }

    public LifecycleFluent.PreStopNested withNewPreStop(){
            return new PreStopNestedImpl();
    }

    public LifecycleFluent.PreStopNested withNewPreStopLike(Handler item){
            return new PreStopNestedImpl(item);
    }

    public LifecycleFluent.PreStopNested editPreStop(){
            return withNewPreStopLike(getPreStop());
    }

    public LifecycleFluent.PreStopNested editOrNewPreStop(){
            return withNewPreStopLike(getPreStop() != null ? getPreStop(): new HandlerBuilder().build());
    }

    public LifecycleFluent.PreStopNested editOrNewPreStopLike(Handler item){
            return withNewPreStopLike(getPreStop() != null ? getPreStop(): item);
    }

    public boolean equals(Object o){
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            if (!super.equals(o)) return false;
            LifecycleFluentImpl that = (LifecycleFluentImpl) o;
            if (postStart != null ? !postStart.equals(that.postStart) :that.postStart != null) return false;
            if (preStop != null ? !preStop.equals(that.preStop) :that.preStop != null) return false;
            return true;
    }


    public class PostStartNestedImpl extends HandlerFluentImpl> implements LifecycleFluent.PostStartNested,io.alauda.kubernetes.api.builder.Nested{

            private final HandlerBuilder builder;
    
            PostStartNestedImpl(Handler item){
                    this.builder = new HandlerBuilder(this, item);
            }
            PostStartNestedImpl(){
                    this.builder = new HandlerBuilder(this);
            }
    
    public N and(){
            return (N) LifecycleFluentImpl.this.withPostStart(builder.build());
    }
    public N endPostStart(){
            return and();
    }

}
    public class PreStopNestedImpl extends HandlerFluentImpl> implements LifecycleFluent.PreStopNested,io.alauda.kubernetes.api.builder.Nested{

            private final HandlerBuilder builder;
    
            PreStopNestedImpl(Handler item){
                    this.builder = new HandlerBuilder(this, item);
            }
            PreStopNestedImpl(){
                    this.builder = new HandlerBuilder(this);
            }
    
    public N and(){
            return (N) LifecycleFluentImpl.this.withPreStop(builder.build());
    }
    public N endPreStop(){
            return and();
    }

}


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy