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

io.fabric8.kubernetes.api.model.LifecycleFluentImpl Maven / Gradle / Ivy

There is a newer version: 4.1.1
Show newest version
package io.fabric8.kubernetes.api.model;

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

public class LifecycleFluentImpl> extends BaseFluent implements LifecycleFluent{

    private VisitableBuilder postStart;
    private VisitableBuilder preStop;

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

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

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

    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 Handler getPreStop(){
            return this.preStop!=null?this.preStop.build():null;
    }

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

    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 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,Nested{

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

}
    public class PreStopNestedImpl extends HandlerFluentImpl> implements LifecycleFluent.PreStopNested,Nested{

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

}


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy