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

me.snowdrop.istio.api.IstioResourceListFluentImpl Maven / Gradle / Ivy

package me.snowdrop.istio.api;

import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.ArrayList;
import java.lang.String;
import javax.validation.constraints.NotNull;
import io.fabric8.kubernetes.api.builder.Predicate;
import io.fabric8.kubernetes.api.model.ListMeta;
import javax.validation.Valid;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import java.util.Collection;
import java.lang.Object;
import java.util.List;
import java.lang.Boolean;

public class IstioResourceListFluentImpl> extends io.fabric8.kubernetes.api.builder.BaseFluent implements IstioResourceListFluent{

    private String apiVersion;
    private List items;
    private String kind;
    private ListMeta metadata;

    public IstioResourceListFluentImpl(){
    }
    public IstioResourceListFluentImpl(IstioResourceList instance){
            this.withApiVersion(instance.getApiVersion()); 
            this.withItems(instance.getItems()); 
            this.withKind(instance.getKind()); 
            this.withMetadata(instance.getMetadata()); 
    }

    public String getApiVersion(){
            return this.apiVersion;
    }

    public A withApiVersion(String apiVersion){
            this.apiVersion=apiVersion; return (A) this;
    }

    public Boolean hasApiVersion(){
            return this.apiVersion != null;
    }

    public A addToItems(int index,IstioResource item){
            if (this.items == null) {this.items = new ArrayList();}
            this.items.add(index, item);
            return (A)this;
    }

    public A setToItems(int index,IstioResource item){
            if (this.items == null) {this.items = new ArrayList();}
            this.items.set(index, item); return (A)this;
    }

    public A addToItems(IstioResource... items){
            if (this.items == null) {this.items = new ArrayList();}
            for (IstioResource item : items) {this.items.add(item);} return (A)this;
    }

    public A addAllToItems(Collection items){
            if (this.items == null) {this.items = new ArrayList();}
            for (IstioResource item : items) {this.items.add(item);} return (A)this;
    }

    public A removeFromItems(IstioResource... items){
            for (IstioResource item : items) {if (this.items!= null){ this.items.remove(item);}} return (A)this;
    }

    public A removeAllFromItems(Collection items){
            for (IstioResource item : items) {if (this.items!= null){ this.items.remove(item);}} return (A)this;
    }

    public List getItems(){
            return this.items;
    }

    public IstioResource getItem(int index){
            return this.items.get(index);
    }

    public IstioResource getFirstItem(){
            return this.items.get(0);
    }

    public IstioResource getLastItem(){
            return this.items.get(items.size() - 1);
    }

    public IstioResource getMatchingItem(io.fabric8.kubernetes.api.builder.Predicate predicate){
            for (IstioResource item: items) { if(predicate.apply(item)){return item;} } return null;
    }

    public A withItems(List items){
            if (this.items != null) { _visitables.removeAll(this.items);}
            if (items != null) {this.items = new ArrayList(); for (IstioResource item : items){this.addToItems(item);}} else { this.items = null;} return (A) this;
    }

    public A withItems(IstioResource... items){
            if (this.items != null) {this.items.clear();}
            if (items != null) {for (IstioResource item :items){ this.addToItems(item);}} return (A) this;
    }

    public Boolean hasItems(){
            return items != null && !items.isEmpty();
    }

    public String getKind(){
            return this.kind;
    }

    public A withKind(String kind){
            this.kind=kind; return (A) this;
    }

    public Boolean hasKind(){
            return this.kind != null;
    }

    public ListMeta getMetadata(){
            return this.metadata;
    }

    public A withMetadata(ListMeta metadata){
            this.metadata=metadata; return (A) this;
    }

    public Boolean hasMetadata(){
            return this.metadata != null;
    }

    public A withNewMetadata(String _continue,String resourceVersion,String selfLink){
            return (A)withMetadata(new ListMeta(_continue, resourceVersion, selfLink));
    }

    public boolean equals(Object o){
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            if (!super.equals(o)) return false;
            IstioResourceListFluentImpl that = (IstioResourceListFluentImpl) o;
            if (apiVersion != null ? !apiVersion.equals(that.apiVersion) :that.apiVersion != null) return false;
            if (items != null ? !items.equals(that.items) :that.items != null) return false;
            if (kind != null ? !kind.equals(that.kind) :that.kind != null) return false;
            if (metadata != null ? !metadata.equals(that.metadata) :that.metadata != null) return false;
            return true;
    }




}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy