> + @Inject
> + public VersionAwareRegionToEndpoint(@Region Supplier<Map<String,
> Supplier<URI>>> regionToEndpointSupplier) {
> + this.regionToEndpointSupplier = checkNotNull(regionToEndpointSupplier,
> "regionToEndpointSupplier");
> + }
> +
> + @Override
> + public URI apply(@Nullable Object from) {
> + checkArgument(from != null && 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);
> + String uri = regionToEndpoint.get(from).get().toString();
> +
> + /**
> + * A quick fix to ensure Neutron works with endpoint definitions that
> are not version-agnostic.
kill me for saying this, but.. multi-line comment form for a single line
comment? // ?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/169/files#r20174946