org.jclouds.digitalocean.compute.util
Class LocationNamingUtils

java.lang.Object
  extended by org.jclouds.digitalocean.compute.util.LocationNamingUtils

public class LocationNamingUtils
extends Object

Utility class to encode and decode the region id and name in a Location.

Author:
Ignasi Barrera

Constructor Summary
LocationNamingUtils()
           
 
Method Summary
static String encodeRegionIdAndName(Region region)
          Encodes the id and name of the given region into a String so it can be populated in a Location object.
static int extractRegionId(org.jclouds.domain.Location location)
          Extracts the region id for the given location.
static String extractRegionName(org.jclouds.domain.Location location)
          Extracts the region name for the given location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocationNamingUtils

public LocationNamingUtils()
Method Detail

extractRegionId

public static int extractRegionId(org.jclouds.domain.Location location)
Extracts the region id for the given location.

Parameters:
location - The location to extract the region id from.
Returns:
The id of the region.

extractRegionName

public static String extractRegionName(org.jclouds.domain.Location location)
Extracts the region name for the given location.

Parameters:
location - The location to extract the region name from.
Returns:
The name of the region.

encodeRegionIdAndName

public static String encodeRegionIdAndName(Region region)
Encodes the id and name of the given region into a String so it can be populated in a Location object.

Parameters:
region - The region to encode.
Returns:
The encoded id and name for the given region.


Copyright © 2009-2014 The Apache Software Foundation. All Rights Reserved.