mirror of
https://github.com/apache/jclouds.git
synced 2025-02-10 12:06:14 +00:00
Removed @Nullable annotations on region parameters
This commit is contained in:
parent
aa04ef007f
commit
4030a4c4f0
@ -16,7 +16,6 @@
|
||||
*/
|
||||
package org.jclouds.rackspace.cloudfiles.v1;
|
||||
|
||||
import org.jclouds.javax.annotation.Nullable;
|
||||
import org.jclouds.openstack.swift.v1.SwiftApi;
|
||||
import org.jclouds.rackspace.cloudfiles.v1.features.CDNApi;
|
||||
import org.jclouds.rackspace.cloudfiles.v1.functions.RegionToCDNEndpoint;
|
||||
@ -47,7 +46,7 @@ public interface CloudFilesApi extends SwiftApi {
|
||||
* @return the {@link CDNApi} for the specified region.
|
||||
*/
|
||||
@Delegate
|
||||
CDNApi getCDNApi(@EndpointParam(parser = RegionToCDNEndpoint.class) @Nullable String region);
|
||||
CDNApi getCDNApi(@EndpointParam(parser = RegionToCDNEndpoint.class) String region);
|
||||
|
||||
/**
|
||||
* Provides access to Cloud Files CDN features.
|
||||
@ -60,5 +59,5 @@ public interface CloudFilesApi extends SwiftApi {
|
||||
*/
|
||||
@Deprecated
|
||||
@Delegate
|
||||
CDNApi cdnApiInRegion(@EndpointParam(parser = RegionToCDNEndpoint.class) @Nullable String region);
|
||||
CDNApi cdnApiInRegion(@EndpointParam(parser = RegionToCDNEndpoint.class) String region);
|
||||
}
|
||||
|
@ -39,7 +39,6 @@ import org.jclouds.Fallbacks.FalseOnNotFoundOr404;
|
||||
import org.jclouds.Fallbacks.NullOnNotFoundOr404;
|
||||
import org.jclouds.javax.annotation.Nullable;
|
||||
import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest;
|
||||
import org.jclouds.rackspace.cloudfiles.v1.CloudFilesApi;
|
||||
import org.jclouds.rackspace.cloudfiles.v1.binders.BindCDNPurgeEmailAddressesToHeaders;
|
||||
import org.jclouds.rackspace.cloudfiles.v1.domain.CDNContainer;
|
||||
import org.jclouds.rackspace.cloudfiles.v1.functions.ParseCDNContainerFromHeaders;
|
||||
@ -65,7 +64,7 @@ import com.google.common.collect.FluentIterable;
|
||||
* noted in the service catalog for Cloud Files during Authentication and set the
|
||||
* <code>X-CDN-Enabled</code> header to <code>true</code>.
|
||||
*
|
||||
* @see {@link CloudFilesApi#getCDNApiForRegion(String)}
|
||||
* @see {@link org.jclouds.rackspace.cloudfiles.v1.CloudFilesApi#getCDNApi(String)}
|
||||
*/
|
||||
@Beta
|
||||
@RequestFilters(AuthenticateRequest.class)
|
||||
|
@ -60,7 +60,7 @@ public class ParseCDNContainerFromHeaders implements Function<HttpResponse, CDNC
|
||||
|
||||
// just need the name from the path
|
||||
List<String> parts = newArrayList(Splitter.on('/').split(request.getEndpoint().getPath()));
|
||||
checkArgument(parts.size() > 0);
|
||||
checkArgument(!parts.isEmpty());
|
||||
|
||||
return CDNContainer.builder().name(parts.get(parts.size() - 1))
|
||||
.enabled(Boolean.parseBoolean(enabled))
|
||||
|
@ -65,7 +65,7 @@ public class RegionToCDNEndpoint implements Function<Object, URI> {
|
||||
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 = endpointsSupplier.get();
|
||||
checkState(regionToEndpoint.size() > 0, "no region name to endpoint mappings configured!");
|
||||
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);
|
||||
return regionToEndpoint.get(from).get();
|
||||
|
Loading…
x
Reference in New Issue
Block a user