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

me.snowdrop.istio.adapter.prometheus.MetricInfoFluentImpl Maven / Gradle / Ivy

package me.snowdrop.istio.adapter.prometheus;

import javax.validation.constraints.Pattern;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonProperty;
import javax.validation.constraints.Size;
import io.fabric8.kubernetes.api.builder.Nested;
import java.util.ArrayList;
import java.lang.String;
import io.fabric8.kubernetes.api.builder.Predicate;
import java.lang.Deprecated;
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 MetricInfoFluentImpl> extends io.fabric8.kubernetes.api.builder.BaseFluent implements me.snowdrop.istio.adapter.prometheus.MetricInfoFluent{

    private MetricInfo_BucketsDefinitionBuilder buckets;
    private String description;
    private String instanceName;
    private Kind kind;
    private List labelNames;
    private String name;
    private String namespace;

    public MetricInfoFluentImpl(){
    }
    public MetricInfoFluentImpl(me.snowdrop.istio.adapter.prometheus.MetricInfo instance){
            this.withBuckets(instance.getBuckets()); 
            this.withDescription(instance.getDescription()); 
            this.withInstanceName(instance.getInstanceName()); 
            this.withKind(instance.getKind()); 
            this.withLabelNames(instance.getLabelNames()); 
            this.withName(instance.getName()); 
            this.withNamespace(instance.getNamespace()); 
    }

    
/**
 * This method has been deprecated, please use method buildBuckets instead.
 */
@Deprecated public MetricInfo_BucketsDefinition getBuckets(){
            return this.buckets!=null?this.buckets.build():null;
    }

    public MetricInfo_BucketsDefinition buildBuckets(){
            return this.buckets!=null?this.buckets.build():null;
    }

    public A withBuckets(MetricInfo_BucketsDefinition buckets){
            _visitables.remove(this.buckets);
            if (buckets!=null){ this.buckets= new MetricInfo_BucketsDefinitionBuilder(buckets); _visitables.add(this.buckets);} return (A) this;
    }

    public Boolean hasBuckets(){
            return this.buckets != null;
    }

    public A withNewBuckets(Object definition){
            return (A)withBuckets(new MetricInfo_BucketsDefinition(definition));
    }

    public MetricInfoFluent.BucketsNested withNewBuckets(){
            return new BucketsNestedImpl();
    }

    public MetricInfoFluent.BucketsNested withNewBucketsLike(MetricInfo_BucketsDefinition item){
            return new BucketsNestedImpl(item);
    }

    public MetricInfoFluent.BucketsNested editBuckets(){
            return withNewBucketsLike(getBuckets());
    }

    public MetricInfoFluent.BucketsNested editOrNewBuckets(){
            return withNewBucketsLike(getBuckets() != null ? getBuckets(): new MetricInfo_BucketsDefinitionBuilder().build());
    }

    public MetricInfoFluent.BucketsNested editOrNewBucketsLike(MetricInfo_BucketsDefinition item){
            return withNewBucketsLike(getBuckets() != null ? getBuckets(): item);
    }

    public String getDescription(){
            return this.description;
    }

    public A withDescription(String description){
            this.description=description; return (A) this;
    }

    public Boolean hasDescription(){
            return this.description != null;
    }

    public String getInstanceName(){
            return this.instanceName;
    }

    public A withInstanceName(String instanceName){
            this.instanceName=instanceName; return (A) this;
    }

    public Boolean hasInstanceName(){
            return this.instanceName != null;
    }

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

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

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

    public A addToLabelNames(int index,String item){
            if (this.labelNames == null) {this.labelNames = new ArrayList();}
            this.labelNames.add(index, item);
            return (A)this;
    }

    public A setToLabelNames(int index,String item){
            this.labelNames.set(index, item); return (A)this;
    }

    public A addToLabelNames(String... items){
            for (String item : items) {this.labelNames.add(item);} return (A)this;
    }

    public A addAllToLabelNames(Collection items){
            for (String item : items) {this.labelNames.add(item);} return (A)this;
    }

    public A removeFromLabelNames(String... items){
            for (String item : items) {if (this.labelNames!= null){ this.labelNames.remove(item);}} return (A)this;
    }

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

    public List getLabelNames(){
            return this.labelNames;
    }

    public String getLabelName(int index){
            return this.labelNames.get(index);
    }

    public String getFirstLabelName(){
            return this.labelNames.get(0);
    }

    public String getLastLabelName(){
            return this.labelNames.get(labelNames.size() - 1);
    }

    public String getMatchingLabelName(io.fabric8.kubernetes.api.builder.Predicate predicate){
            for (String item: labelNames) { if(predicate.apply(item)){return item;} } return null;
    }

    public A withLabelNames(List labelNames){
            if (this.labelNames != null) { _visitables.removeAll(this.labelNames);}
            if (labelNames != null) {this.labelNames = new ArrayList(); for (String item : labelNames){this.addToLabelNames(item);}} else { this.labelNames = null;} return (A) this;
    }

    public A withLabelNames(String... labelNames){
            this.labelNames.clear(); if (labelNames != null) {for (String item :labelNames){ this.addToLabelNames(item);}} return (A) this;
    }

    public Boolean hasLabelNames(){
            return labelNames != null && !labelNames.isEmpty();
    }

    public String getName(){
            return this.name;
    }

    public A withName(String name){
            this.name=name; return (A) this;
    }

    public Boolean hasName(){
            return this.name != null;
    }

    public String getNamespace(){
            return this.namespace;
    }

    public A withNamespace(String namespace){
            this.namespace=namespace; return (A) this;
    }

    public Boolean hasNamespace(){
            return this.namespace != 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;
            MetricInfoFluentImpl that = (MetricInfoFluentImpl) o;
            if (buckets != null ? !buckets.equals(that.buckets) :that.buckets != null) return false;
            if (description != null ? !description.equals(that.description) :that.description != null) return false;
            if (instanceName != null ? !instanceName.equals(that.instanceName) :that.instanceName != null) return false;
            if (kind != null ? !kind.equals(that.kind) :that.kind != null) return false;
            if (labelNames != null ? !labelNames.equals(that.labelNames) :that.labelNames != null) return false;
            if (name != null ? !name.equals(that.name) :that.name != null) return false;
            if (namespace != null ? !namespace.equals(that.namespace) :that.namespace != null) return false;
            return true;
    }


    public class BucketsNestedImpl extends MetricInfo_BucketsDefinitionFluentImpl> implements MetricInfoFluent.BucketsNested,io.fabric8.kubernetes.api.builder.Nested{

            private final MetricInfo_BucketsDefinitionBuilder builder;
    
            BucketsNestedImpl(MetricInfo_BucketsDefinition item){
                    this.builder = new MetricInfo_BucketsDefinitionBuilder(this, item);
            }
            BucketsNestedImpl(){
                    this.builder = new MetricInfo_BucketsDefinitionBuilder(this);
            }
    
    public N and(){
            return (N) MetricInfoFluentImpl.this.withBuckets(builder.build());
    }
    public N endBuckets(){
            return and();
    }

}


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy