Fixed pluralization, Javadoc, Nullable, and static import stuff.

This commit is contained in:
Everett Toews 2013-04-02 19:23:40 -05:00
parent f0a1054958
commit 51a73e76dc
5 changed files with 26 additions and 24 deletions

View File

@ -168,7 +168,7 @@ public class CreateLoadBalancer extends BaseLoadBalancer<AddNode, CreateLoadBala
*/ */
@Override @Override
public Builder nodes(Iterable<AddNode> addNodes) { public Builder nodes(Iterable<AddNode> addNodes) {
this.nodes = ImmutableSet.<AddNode> copyOf(checkNotNull(addNodes, "nodes")); this.nodes = ImmutableSet.<AddNode> copyOf(checkNotNull(addNodes, "addNodes"));
return this; return this;
} }
@ -176,8 +176,8 @@ public class CreateLoadBalancer extends BaseLoadBalancer<AddNode, CreateLoadBala
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override @Override
public Builder node(AddNode nodes) { public Builder node(AddNode node) {
this.nodes.add(checkNotNull(nodes, "nodes")); this.nodes.add(checkNotNull(node, "node"));
return this; return this;
} }

View File

@ -21,8 +21,8 @@ package org.jclouds.rackspace.cloudloadbalancers.v1.domain;
import java.util.Map; import java.util.Map;
import com.google.common.collect.ForwardingMap; import com.google.common.collect.ForwardingMap;
import com.google.common.collect.Maps; import static com.google.common.collect.Maps.newHashMap;
import com.google.common.collect.Sets; import static com.google.common.collect.Sets.newHashSet;
/** /**
* Key and value must be 256 characters or less. All UTF-8 characters are valid. * Key and value must be 256 characters or less. All UTF-8 characters are valid.
@ -32,8 +32,8 @@ import com.google.common.collect.Sets;
* @author Everett Toews * @author Everett Toews
*/ */
public class Metadata extends ForwardingMap<String, String> { public class Metadata extends ForwardingMap<String, String> {
private final Map<String, String> metadata = Maps.newHashMap(); private final Map<String, String> metadata = newHashMap();
private final Map<String, Integer> keyToId = Maps.newHashMap(); private final Map<String, Integer> keyToId = newHashMap();
public Metadata(Metadata metadata) { public Metadata(Metadata metadata) {
super(); super();
@ -58,6 +58,6 @@ public class Metadata extends ForwardingMap<String, String> {
} }
public Iterable<Integer> getIds() { public Iterable<Integer> getIds() {
return Sets.newHashSet(keyToId.values()); return newHashSet(keyToId.values());
} }
} }

View File

@ -18,6 +18,7 @@
*/ */
package org.jclouds.rackspace.cloudloadbalancers.v1.domain; package org.jclouds.rackspace.cloudloadbalancers.v1.domain;
import org.jclouds.javax.annotation.Nullable;
import org.jclouds.rackspace.cloudloadbalancers.v1.domain.internal.BaseLoadBalancer; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.internal.BaseLoadBalancer;
import org.jclouds.rackspace.cloudloadbalancers.v1.domain.internal.BaseLoadBalancer.Algorithm; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.internal.BaseLoadBalancer.Algorithm;
@ -37,8 +38,8 @@ public class UpdateLoadBalancer {
private final Integer timeout; private final Integer timeout;
private final Boolean halfClosed; private final Boolean halfClosed;
protected UpdateLoadBalancer(String name, String protocol, Integer port, Algorithm algorithm, Integer timeout, protected UpdateLoadBalancer(@Nullable String name, @Nullable String protocol, @Nullable Integer port,
Boolean halfClosed) { @Nullable Algorithm algorithm, @Nullable Integer timeout, @Nullable Boolean halfClosed) {
this.name = name; this.name = name;
this.protocol = protocol; this.protocol = protocol;
this.port = port; this.port = port;

View File

@ -18,6 +18,7 @@
*/ */
package org.jclouds.rackspace.cloudloadbalancers.v1.domain; package org.jclouds.rackspace.cloudloadbalancers.v1.domain;
import org.jclouds.javax.annotation.Nullable;
import org.jclouds.rackspace.cloudloadbalancers.v1.domain.internal.BaseNode; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.internal.BaseNode;
import org.jclouds.rackspace.cloudloadbalancers.v1.domain.internal.BaseNode.Condition; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.internal.BaseNode.Condition;
import org.jclouds.rackspace.cloudloadbalancers.v1.domain.internal.BaseNode.Type; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.internal.BaseNode.Type;
@ -35,7 +36,7 @@ public class UpdateNode {
private final Type type; private final Type type;
private final Integer weight; private final Integer weight;
protected UpdateNode(Condition condition, Type type, Integer weight) { protected UpdateNode(@Nullable Condition condition, @Nullable Type type, @Nullable Integer weight) {
this.condition = condition; this.condition = condition;
this.type = type; this.type = type;
this.weight = weight; this.weight = weight;

View File

@ -29,7 +29,7 @@ import org.jclouds.rackspace.cloudloadbalancers.v1.domain.ConnectionThrottle;
import org.jclouds.rackspace.cloudloadbalancers.v1.domain.HealthMonitor; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.HealthMonitor;
import org.jclouds.rackspace.cloudloadbalancers.v1.domain.LoadBalancer; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.LoadBalancer;
import org.jclouds.rackspace.cloudloadbalancers.v1.domain.SessionPersistence; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.SessionPersistence;
import org.jclouds.rackspace.cloudloadbalancers.v1.features.LoadBalancerApi; import org.jclouds.rackspace.cloudloadbalancers.v1.features.ReportApi;
import com.google.common.base.Objects; import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper; import com.google.common.base.Objects.ToStringHelper;
@ -261,7 +261,7 @@ public class BaseLoadBalancer<N extends BaseNode<N>, T extends BaseLoadBalancer<
/** /**
* Required. Protocol of the service which is being load balanced. * Required. Protocol of the service which is being load balanced.
* *
* @see LoadBalancerApi#listProtocols() * @see ReportApi#listProtocols()
*/ */
public Builder<N, T> protocol(String protocol) { public Builder<N, T> protocol(String protocol) {
this.protocol = protocol; this.protocol = protocol;
@ -269,8 +269,8 @@ public class BaseLoadBalancer<N extends BaseNode<N>, T extends BaseLoadBalancer<
} }
/** /**
* Required if the protocol being used is not in LoadBalancerApi#listProtocols() or the protocol is in * Required if the protocol being used is not in {@link ReportApi#listProtocols()} or the protocol is in
* LoadBalancerApi#listProtocols() but port=0. Port number for the service you are load balancing. * {@link ReportApi#listProtocols()} but port=0. Port number for the service you are load balancing.
*/ */
public Builder<N, T> port(@Nullable Integer port) { public Builder<N, T> port(@Nullable Integer port) {
this.port = port; this.port = port;