public URI apply()

in openstack-glance/src/main/java/org/jclouds/openstack/glance/functions/RegionToEndpointNegotiateVersion.java [127:140]


   public URI apply(Object from) {
      checkArgument(from instanceof String, "you must specify a region, as a String argument");
      Map<String, Supplier<URI>> regionToEndpoint = regionToEndpointSupplier.get();
      checkState(!regionToEndpoint.isEmpty(), "no region name to endpoint mappings configured!");
      checkArgument(regionToEndpoint.containsKey(from),
               "requested location %s, which is not in the configured locations: %s", from, regionToEndpoint);
      URI uri = regionToEndpointSupplier.get().get(from).get();

      try {
         return endpointCache.get(uri);
      } catch (ExecutionException ex) {
         throw Throwables.propagate(ex);
      }
    }