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

com.huawei.openstack4j.openstack.identity.v2.domain.KeystoneEndpoint Maven / Gradle / Ivy

/*******************************************************************************
 * 	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.identity.v2.domain;

import java.net.URI;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.huawei.openstack4j.model.identity.v2.Endpoint;
import com.huawei.openstack4j.model.identity.v2.builder.EndpointBuilder;
import com.huawei.openstack4j.openstack.common.ListResult;

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;

/**
 * Endpoint Model is used to describe a network address which is described by URL's and other service
 * information depending on the context it was retrieved in.
 *
 * @author Jeremy Unruh
 *
 * @see  {
		private static final long serialVersionUID = 1L;

		@JsonProperty("endpoints")
		private List endpoints;

		public List value() {
			return endpoints;
		}
	}

	public static class EndPointConcreteBuilder implements EndpointBuilder {

		protected KeystoneEndpoint model;

		protected EndPointConcreteBuilder() {
			this(new KeystoneEndpoint());
		}

		EndPointConcreteBuilder(KeystoneEndpoint model) {
			this.model = model;
		}

		/**
		 * @see KeystoneEndpoint#getRegion()
		 */
		public EndpointBuilder region(String region) {
			model.region = region;
			return this;
		}

		/**
		 * @see KeystoneEndpoint#getPublicURL()
		 */
		public EndpointBuilder publicURL(URI publicURL) {
			model.publicURL = publicURL;
			return this;
		}

		/**
		 * @see KeystoneEndpoint#getInternalURL()
		 */
		public EndpointBuilder internalURL(URI internalURL) {
			model.internalURL = internalURL;
			return this;
		}

		/**
		 * @see KeystoneEndpoint#getTenantId()
		 */
		public EndpointBuilder tenantId(String tenantId) {
			model.tenantId = tenantId;
			return this;
		}

		/**
		 * @see KeystoneEndpoint#getType()
		 */
		public EndpointBuilder type(String type) {
			model.type = type;
			return this;
		}

		/**
		 * @see KeystoneEndpoint#getId()
		 */
		public EndpointBuilder id(String id) {
			model.id = id;
			return this;
		}

		/**
		 * @see KeystoneEndpoint#getName()
		 */
		public EndpointBuilder name(String name) {
			model.name = name;
			return this;
		}

		/**
		 * @see KeystoneEndpoint#getAdminURL()
		 */
		public EndpointBuilder adminURL(URI adminURL) {
			model.adminURL = adminURL;
			return this;
		}

		/**
		 * @see KeystoneEndpoint#getVersionInfo()
		 */
		public EndpointBuilder versionInfo(URI versionInfo) {
			model.versionInfo = versionInfo;
			return this;
		}

		/**
		 * @see KeystoneEndpoint#getVersionList()
		 */
		public EndpointBuilder versionList(URI versionList) {
			model.versionList = versionList;
			return this;
		}

		@Override
		public KeystoneEndpoint build() {
			return model;
		}

		@Override
		public EndpointBuilder from(Endpoint in) {
			this.model = (KeystoneEndpoint)in;
			return this;
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy