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

com.spotinst.sdkjava.model.ElastigroupScalingConfiguration Maven / Gradle / Ivy

There is a newer version: 1.0.121
Show newest version
package com.spotinst.sdkjava.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import java.util.*;

/**
 * Created by aharontwizer on 8/27/15.
 */
@JsonIgnoreProperties(ignoreUnknown = true)
public class ElastigroupScalingConfiguration {
    //region Members
    // Partial Update support
    @JsonIgnore
    private Set isSet;
    private List up;
    private List down;
    private List target;
    //endregion

    //region Constructor

    private ElastigroupScalingConfiguration() {
        isSet = new HashSet<>();
    }
    //endregion

    //region Getters & Setters


    public Set getIsSet() {
        return isSet;
    }

    public void setIsSet(Set isSet) {
        this.isSet = isSet;
    }

    //region Up
    public List getUp() {
        return up;
    }

    public void setUp(List up) {
        isSet.add("up");
        this.up = up;
    }

    //endregion

    //region Down
    public List getDown() {
        return down;
    }

    public void setDown(List down) {
        isSet.add("down");
        this.down = down;
    }

    //endregion

    //region Target
    public List getTarget() {
        return target;
    }

    public void setTarget(List target) {
        isSet.add("target");
        this.target = target;
    }

    //endregion

    //endregion

    //region Object overrides
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ElastigroupScalingConfiguration elastigroupScalingConfiguration = (ElastigroupScalingConfiguration) o;

        if (!Objects.equals(up, elastigroupScalingConfiguration.up)) return false;
        if (!Objects.equals(down, elastigroupScalingConfiguration.down)) return false;
        return !(!Objects.equals(target, elastigroupScalingConfiguration.target));

    }

    @Override
    public int hashCode() {
        int result = up != null ? up.hashCode() : 0;
        result = 31 * result + (down != null ? down.hashCode() : 0);
        result = 31 * result + (target != null ? target.hashCode() : 0);
        return result;
    }
    //endregion

    //region Builder class
    public static class Builder {
        private ElastigroupScalingConfiguration elastigroupScalingConfiguration;

        private Builder() {
            this.elastigroupScalingConfiguration = new ElastigroupScalingConfiguration();
        }

        public static Builder get(){
            return new Builder();
        }

        public Builder setDown(final List downScalingPolicies) {
            elastigroupScalingConfiguration.setDown(downScalingPolicies);
            return this;
        }

        public Builder setUp(final List upScalingPolicies) {
            elastigroupScalingConfiguration.setUp(upScalingPolicies);
            return this;
        }

        public Builder setTarget(final List targetScalingPolicies) {
            elastigroupScalingConfiguration.setTarget(targetScalingPolicies);
            return this;
        }

        public ElastigroupScalingConfiguration build() {
            // TODO : Validations
            return elastigroupScalingConfiguration;
        }
    }
    //endregion
    //region isSet methods
    // Is up Set boolean method
    @JsonIgnore
    public boolean isUpSet() {
        return isSet.contains("up");
    }

    // Is down Set boolean method
    @JsonIgnore
    public boolean isDownSet() {
        return isSet.contains("down");
    }

    // Is target Set boolean method
    @JsonIgnore
    public boolean isTargetSet() {
        return isSet.contains("target");
    }

    //endregion
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy