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

io.fabric8.openshift.api.model.ImageSourceFluentImpl Maven / Gradle / Ivy

There is a newer version: 4.1.1
Show newest version
package io.fabric8.openshift.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.util.List;
import java.util.ArrayList;
import io.fabric8.kubernetes.api.model.ObjectReference;
import java.lang.String;
import io.fabric8.kubernetes.api.model.LocalObjectReference;
import java.lang.Object;
import io.fabric8.kubernetes.api.builder.Nested;
import io.fabric8.kubernetes.api.model.ObjectReferenceFluentImpl;
import io.fabric8.kubernetes.api.model.ObjectReferenceBuilder;
import io.fabric8.kubernetes.api.model.LocalObjectReferenceFluentImpl;
import io.fabric8.kubernetes.api.model.LocalObjectReferenceBuilder;

public class ImageSourceFluentImpl> extends BaseFluent implements ImageSourceFluent{

    private VisitableBuilder from;
    private List> paths =  new ArrayList>();
    private VisitableBuilder pullSecret;

    public ImageSourceFluentImpl(){
    }
    public ImageSourceFluentImpl(ImageSource instance){
            this.withFrom(instance.getFrom()); 
            this.withPaths(instance.getPaths()); 
            this.withPullSecret(instance.getPullSecret()); 
    }

    public ObjectReference getFrom(){
            return this.from!=null?this.from.build():null;
    }

    public A withFrom(ObjectReference from){
            if (from!=null){ this.from= new ObjectReferenceBuilder(from); _visitables.add(this.from);} return (A) this;
    }

    public ImageSourceFluent.FromNested withNewFrom(){
            return new FromNestedImpl();
    }

    public ImageSourceFluent.FromNested withNewFromLike(ObjectReference item){
            return new FromNestedImpl(item);
    }

    public ImageSourceFluent.FromNested editFrom(){
            return withNewFromLike(getFrom());
    }

    public A addToPaths(ImageSourcePath... items){
            for (ImageSourcePath item : items) {ImageSourcePathBuilder builder = new ImageSourcePathBuilder(item);_visitables.add(builder);this.paths.add(builder);} return (A)this;
    }

    public A removeFromPaths(ImageSourcePath... items){
            for (ImageSourcePath item : items) {ImageSourcePathBuilder builder = new ImageSourcePathBuilder(item);_visitables.remove(builder);this.paths.remove(builder);} return (A)this;
    }

    public List getPaths(){
            return build(paths);
    }

    public A withPaths(List paths){
            this.paths.clear();
            if (paths != null) {for (ImageSourcePath item : paths){this.addToPaths(item);}} return (A) this;
    }

    public A withPaths(ImageSourcePath... paths){
            this.paths.clear(); if (paths != null) {for (ImageSourcePath item :paths){ this.addToPaths(item);}} return (A) this;
    }

    public ImageSourceFluent.PathsNested addNewPath(){
            return new PathsNestedImpl();
    }

    public ImageSourceFluent.PathsNested addNewPathLike(ImageSourcePath item){
            return new PathsNestedImpl(item);
    }

    public A addNewPath(String destinationDir,String sourcePath){
            return (A)addToPaths(new ImageSourcePath(destinationDir, sourcePath));
    }

    public LocalObjectReference getPullSecret(){
            return this.pullSecret!=null?this.pullSecret.build():null;
    }

    public A withPullSecret(LocalObjectReference pullSecret){
            if (pullSecret!=null){ this.pullSecret= new LocalObjectReferenceBuilder(pullSecret); _visitables.add(this.pullSecret);} return (A) this;
    }

    public ImageSourceFluent.PullSecretNested withNewPullSecret(){
            return new PullSecretNestedImpl();
    }

    public ImageSourceFluent.PullSecretNested withNewPullSecretLike(LocalObjectReference item){
            return new PullSecretNestedImpl(item);
    }

    public ImageSourceFluent.PullSecretNested editPullSecret(){
            return withNewPullSecretLike(getPullSecret());
    }

    public A withNewPullSecret(String name){
            return (A)withPullSecret(new LocalObjectReference(name));
    }

    public boolean equals(Object o){
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            if (!super.equals(o)) return false;
            ImageSourceFluentImpl that = (ImageSourceFluentImpl) o;
            if (from != null ? !from.equals(that.from) :that.from != null) return false;
            if (paths != null ? !paths.equals(that.paths) :that.paths != null) return false;
            if (pullSecret != null ? !pullSecret.equals(that.pullSecret) :that.pullSecret != null) return false;
            return true;
    }


    public class FromNestedImpl extends ObjectReferenceFluentImpl> implements ImageSourceFluent.FromNested,Nested{

            private final ObjectReferenceBuilder builder;
    
            FromNestedImpl(){
                    this.builder = new ObjectReferenceBuilder(this);
            }
            FromNestedImpl(ObjectReference item){
                    this.builder = new ObjectReferenceBuilder(this, item);
            }
    
    public N endFrom(){
            return and();
    }
    public N and(){
            return (N) ImageSourceFluentImpl.this.withFrom(builder.build());
    }

}
    public class PathsNestedImpl extends ImageSourcePathFluentImpl> implements ImageSourceFluent.PathsNested,Nested{

            private final ImageSourcePathBuilder builder;
    
            PathsNestedImpl(){
                    this.builder = new ImageSourcePathBuilder(this);
            }
            PathsNestedImpl(ImageSourcePath item){
                    this.builder = new ImageSourcePathBuilder(this, item);
            }
    
    public N and(){
            return (N) ImageSourceFluentImpl.this.addToPaths(builder.build());
    }
    public N endPath(){
            return and();
    }

}
    public class PullSecretNestedImpl extends LocalObjectReferenceFluentImpl> implements ImageSourceFluent.PullSecretNested,Nested{

            private final LocalObjectReferenceBuilder builder;
    
            PullSecretNestedImpl(){
                    this.builder = new LocalObjectReferenceBuilder(this);
            }
            PullSecretNestedImpl(LocalObjectReference item){
                    this.builder = new LocalObjectReferenceBuilder(this, item);
            }
    
    public N and(){
            return (N) ImageSourceFluentImpl.this.withPullSecret(builder.build());
    }
    public N endPullSecret(){
            return and();
    }

}


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy