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

com.spotinst.sdkjava.model.bl.admin.organization.PolicyStatement Maven / Gradle / Ivy

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

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.spotinst.sdkjava.enums.admin.organization.PolicyEffectEnum;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class PolicyStatement {
    @JsonIgnore
    private Set      isSet;
    private PolicyEffectEnum effect;
    private List     actions;
    private List     resources;

    public PolicyStatement() {
        isSet = new HashSet<>();
    }

    public Set getIsSet() {
        return isSet;
    }

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

    public PolicyEffectEnum getEffect() {
        return effect;
    }

    public void setEffect(PolicyEffectEnum effect) {
        isSet.add("effect");
        this.effect = effect;
    }

    public List getActions() {
        return actions;
    }

    public void setActions(List actions) {
        isSet.add("actions");
        this.actions = actions;
    }

    public List getResources() {
        return resources;
    }

    public void setResources(List resources) {
        isSet.add("resources");
        this.resources = resources;
    }

    public static class Builder {
        private PolicyStatement statements;

        private Builder() {
            this.statements = new PolicyStatement();
        }

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

        public Builder setEffect(final PolicyEffectEnum effect) {
            statements.setEffect(effect);
            return this;
        }

        public Builder setActions(final List actions) {
            statements.setActions(actions);
            return this;
        }

        public Builder setResources(final List resources) {
            statements.setResources(resources);
            return this;
        }

        public PolicyStatement build() {
            return statements;
        }
    }

    @JsonIgnore
    public boolean isEffectSet() {
        return isSet.contains("effect");
    }

    @JsonIgnore
    public boolean isActionsSet() {
        return isSet.contains("actions");
    }

    @JsonIgnore
    public boolean isResourcesSet() {
        return isSet.contains("resources");
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy