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

org.openstack4j.api.types.Facing Maven / Gradle / Ivy

package org.openstack4j.api.types;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * Defines the URL perspective in which the API is accessing data from within an OpenStack deployment.  For example: admin, public, internal
 * @author Jeremy Unruh
 */
public enum Facing {

	INTERNAL,
	ADMIN,
	PUBLIC
	;
	@JsonValue
	public String value() {
		return name().toLowerCase();
	}
	
	@JsonCreator
	public static Facing value(String facing) {
		if (facing == null || facing.isEmpty()) return PUBLIC;
		try
		{
			return valueOf(facing.toUpperCase());
		}
		catch (IllegalArgumentException e) {
			return PUBLIC;
		}
	}
	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy