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

com.huawei.openstack4j.openstack.gbp.domain.GbpNetworkServicePolicy Maven / Gradle / Ivy

There is a newer version: 1.0.26
Show newest version
/*******************************************************************************
 * 	Copyright 2016 ContainX and OpenStack4j                                          
 * 	                                                                                 
 * 	Licensed under the Apache License, Version 2.0 (the "License"); you may not      
 * 	use this file except in compliance with the License. You may obtain a copy of    
 * 	the License at                                                                   
 * 	                                                                                 
 * 	    http://www.apache.org/licenses/LICENSE-2.0                                   
 * 	                                                                                 
 * 	Unless required by applicable law or agreed to in writing, software              
 * 	distributed under the License is distributed on an "AS IS" BASIS, WITHOUT        
 * 	WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the         
 * 	License for the specific language governing permissions and limitations under    
 * 	the License.                                                                     
 *******************************************************************************/
package com.huawei.openstack4j.openstack.gbp.domain;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonRootName;
import com.huawei.openstack4j.model.gbp.NetworkServicePolicy;
import com.huawei.openstack4j.model.gbp.PolicyTargetGroup;
import com.huawei.openstack4j.model.gbp.builder.NetworkServicePolicyBuilder;
import com.huawei.openstack4j.openstack.common.ListResult;

import java.util.List;

/**
 * Created by sumit gandhi on 7/4/2016.
 */

@JsonRootName("network_service_policy")
public class GbpNetworkServicePolicy implements NetworkServicePolicy {
    private static final long serialVersionUID = 1L;
    private String name;
    private String id;
    private String description;
    private boolean shared;
    @JsonProperty("tenant_id")
    private String tenantId;
    @JsonProperty("network_service_params")
    private List gbpNetworkServiceParamsList;
    @JsonProperty("policy_target_groups")
    private List policyTargetGroupList;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String getId() {
        return id;
    }

    @Override
    public void setId(String id) { this.id = id; }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public boolean isShared() {
        return shared;
    }

    public void setShared(boolean shared) {
        this.shared = shared;
    }

    public String getTenantId() {
        return tenantId;
    }

    public void setTenantId(String tenantId) {
        this.tenantId = tenantId;
    }

    public List getGbpNetworkServiceParamsList() {
        return gbpNetworkServiceParamsList;
    }

    public void setGbpNetworkServiceParamsList(List gbpNetworkServiceParamsList) {
        this.gbpNetworkServiceParamsList = gbpNetworkServiceParamsList;
    }

    public List getPolicyTargetGroupList() {
        return policyTargetGroupList;
    }

    @Override
    public NetworkServicePolicyBuilder toBuilder() {
        return new NetworkServicePolicyConcreteBuilder();
    }

    public static class NetworkServicePolicies extends ListResult {

        private static final long serialVersionUID = 1L;
        @JsonProperty("network_service_policies")
        private List gbpNetworkServicePolicyList;

        @Override
        protected List value() {
            return gbpNetworkServicePolicyList;
        }

    }

    public static class NetworkServicePolicyConcreteBuilder implements NetworkServicePolicyBuilder {

        private GbpNetworkServicePolicy networkServicePolicy;

        public NetworkServicePolicyConcreteBuilder(GbpNetworkServicePolicy gbpServicePolicy) {
            this.networkServicePolicy = gbpServicePolicy;
        }

        public NetworkServicePolicyConcreteBuilder() {
            this(new GbpNetworkServicePolicy());
        }

        @Override
        public NetworkServicePolicy build() {
            return networkServicePolicy;
        }

        @Override
        public NetworkServicePolicyBuilder from(NetworkServicePolicy in) {
            this.networkServicePolicy=(GbpNetworkServicePolicy) in;
            return this;
        }

        @Override
        public NetworkServicePolicyBuilder name(String name) {
            this.networkServicePolicy.name=name;
            return this;
        }

        @Override
        public NetworkServicePolicyBuilder description(String description) {
            this.networkServicePolicy.description=description;
            return this;
        }

        @Override
        public NetworkServicePolicyBuilder isShared(boolean shared) {
            this.networkServicePolicy.shared=shared;
            return this;
        }

        @Override
        public NetworkServicePolicyBuilder gbpNetworkServiceParams(List gbpNetworkServiceParamsList) {
            this.networkServicePolicy.gbpNetworkServiceParamsList=gbpNetworkServiceParamsList;
            return this;
        }

    }

    public static NetworkServicePolicyBuilder builder() {
        return new NetworkServicePolicyConcreteBuilder();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy