You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jclouds.apache.org by na...@apache.org on 2013/11/14 12:23:11 UTC
[08/13] Fix code style of the cloudsigma2 provider.
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/0d70c84a/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/IPConfiguration.java
----------------------------------------------------------------------
diff --git a/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/IPConfiguration.java b/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/IPConfiguration.java
index 84fd239..f194ace 100644
--- a/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/IPConfiguration.java
+++ b/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/IPConfiguration.java
@@ -24,79 +24,77 @@ import java.beans.ConstructorProperties;
*/
public class IPConfiguration {
- public static class Builder{
- private IPConfigurationType configurationType;
- private IP ip;
-
- public Builder configurationType(IPConfigurationType configurationType) {
- this.configurationType = configurationType;
- return this;
- }
-
- public Builder ip(IP ip) {
- this.ip = ip;
- return this;
- }
-
- public IPConfiguration build(){
- return new IPConfiguration(configurationType, ip);
- }
- }
-
- @Named("conf")
- private final IPConfigurationType configurationType;
- @Named("ip")
- private final IP ip;
-
- @ConstructorProperties({
- "conf", "ip"
- })
- public IPConfiguration(IPConfigurationType configurationType, IP ip) {
- this.configurationType = configurationType;
- this.ip = ip;
- }
-
- /**
- *
- * @return configuration type
- */
- public IPConfigurationType getConfigurationType() {
- return configurationType;
- }
-
- /**
- *
- * @return An IP address reference. Only used in ’static’ IP configuration.
- */
- public IP getIp() {
- return ip;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (!(o instanceof IPConfiguration)) return false;
-
- IPConfiguration that = (IPConfiguration) o;
-
- if (configurationType != that.configurationType) return false;
- if (ip != null ? !ip.equals(that.ip) : that.ip != null) return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = configurationType != null ? configurationType.hashCode() : 0;
- result = 31 * result + (ip != null ? ip.hashCode() : 0);
- return result;
- }
-
- @Override
- public String toString() {
- return "[" +
- "configurationType=" + configurationType +
- ", ip=" + ip +
- "]";
- }
+ public static class Builder {
+ private IPConfigurationType configurationType;
+ private IP ip;
+
+ public Builder configurationType(IPConfigurationType configurationType) {
+ this.configurationType = configurationType;
+ return this;
+ }
+
+ public Builder ip(IP ip) {
+ this.ip = ip;
+ return this;
+ }
+
+ public IPConfiguration build() {
+ return new IPConfiguration(configurationType, ip);
+ }
+ }
+
+ @Named("conf")
+ private final IPConfigurationType configurationType;
+ @Named("ip")
+ private final IP ip;
+
+ @ConstructorProperties({
+ "conf", "ip"
+ })
+ public IPConfiguration(IPConfigurationType configurationType, IP ip) {
+ this.configurationType = configurationType;
+ this.ip = ip;
+ }
+
+ /**
+ * @return configuration type
+ */
+ public IPConfigurationType getConfigurationType() {
+ return configurationType;
+ }
+
+ /**
+ * @return An IP address reference. Only used in ’static’ IP configuration.
+ */
+ public IP getIp() {
+ return ip;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (!(o instanceof IPConfiguration)) return false;
+
+ IPConfiguration that = (IPConfiguration) o;
+
+ if (configurationType != that.configurationType) return false;
+ if (ip != null ? !ip.equals(that.ip) : that.ip != null) return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = configurationType != null ? configurationType.hashCode() : 0;
+ result = 31 * result + (ip != null ? ip.hashCode() : 0);
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ return "[" +
+ "configurationType=" + configurationType +
+ ", ip=" + ip +
+ "]";
+ }
}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/0d70c84a/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/IPConfigurationType.java
----------------------------------------------------------------------
diff --git a/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/IPConfigurationType.java b/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/IPConfigurationType.java
index 1d6dae1..6433a9f 100644
--- a/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/IPConfigurationType.java
+++ b/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/IPConfigurationType.java
@@ -22,22 +22,22 @@ import static com.google.common.base.Preconditions.checkNotNull;
* @author Vladimir Shevchenko
*/
public enum IPConfigurationType {
- DHCP, STATIC, MANUAL, UNRECOGNIZED;
+ DHCP, STATIC, MANUAL, UNRECOGNIZED;
- public String value() {
- return name().toLowerCase();
- }
+ public String value() {
+ return name().toLowerCase();
+ }
- @Override
- public String toString() {
- return value();
- }
+ @Override
+ public String toString() {
+ return value();
+ }
- public static IPConfigurationType fromValue(String type) {
- try {
- return valueOf(checkNotNull(type, "type").toUpperCase());
- } catch (IllegalArgumentException e) {
- return UNRECOGNIZED;
- }
- }
+ public static IPConfigurationType fromValue(String type) {
+ try {
+ return valueOf(checkNotNull(type, "type").toUpperCase());
+ } catch (IllegalArgumentException e) {
+ return UNRECOGNIZED;
+ }
+ }
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/0d70c84a/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/IPInfo.java
----------------------------------------------------------------------
diff --git a/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/IPInfo.java b/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/IPInfo.java
index 898eb90..796303c 100644
--- a/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/IPInfo.java
+++ b/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/IPInfo.java
@@ -27,221 +27,229 @@ import java.util.Map;
* @author Vladimir Shevchenko
*/
public class IPInfo extends IP {
- public static class Builder extends IP.Builder {
- private Map<String, String> meta;
- private Subscription subscription;
- private List<Tag> tags;
- private List<String> nameservers;
- private int netmask;
- private String gateway;
-
- /**
- * @param meta User defined meta information
- * @return IPInfo Builder
- */
- public Builder meta(Map<String, String> meta) {
- this.meta = meta;
- return this;
- }
-
- /**
- * @param subscription Subscription related to this VLAN
- * @return IPInfo Builder
- */
- public Builder subscription(Subscription subscription) {
- this.subscription = subscription;
- return this;
- }
-
- /**
- * @param tags Tags added to this VLAN
- * @return IPInfo Builder
- */
- public Builder tags(List<Tag> tags) {
- this.tags = ImmutableList.copyOf(tags);
- return this;
- }
-
- /**
- * @param nameservers Servers added to this IP
- * @return IPInfo Builder
- */
- public Builder nameservers(List<String> nameservers) {
- this.nameservers = ImmutableList.copyOf(nameservers);
- return this;
- }
-
- /**
- * @param netmask IP netmask
- * @return IPInfo Builder
- */
- public Builder netmask(int netmask) {
- this.netmask = netmask;
- return this;
- }
-
- /**
- * @param gateway getaway
- * @return IPInfo Builder
- */
- public Builder gateway(String gateway) {
- this.gateway = gateway;
- return this;
- }
-
- /**
- * {@inheritDoc}
- * @return IPInfo Builder
- */
- @Override
- public Builder uuid(String uuid) {
- return Builder.class.cast(super.uuid(uuid));
- }
-
- /**
- * {@inheritDoc}
- * @return IPInfo Builder
- */
- @Override
- public Builder owner(Owner owner) {
- return Builder.class.cast(super.owner(owner));
- }
-
- /**
- * {@inheritDoc}
- * @return IPInfo Builder
- */
- @Override
- public Builder server(Server server) {
- return Builder.class.cast(super.server(server));
- }
-
- /**
- * {@inheritDoc}
- * @return IPInfo Builder
- */
- @Override
- public Builder resourceUri(URI resourceUri) {
- return Builder.class.cast(super.resourceUri(resourceUri));
- }
-
- public IPInfo build() {
- return new IPInfo(uuid, owner, server, resourceUri, meta, subscription, tags, nameservers, netmask, gateway);
- }
-
- public Builder fromIP(IP ip){
- return new Builder().uuid(ip.getUuid()).owner(ip.getOwner()).server(ip.getServer()).resourceUri(ip.getResourceUri());
- }
- }
-
- private final Map<String, String> meta;
- private final Subscription subscription;
- private final List<Tag> tags;
- private final List<String> nameservers;
- private final int netmask;
- private final String gateway;
-
- @ConstructorProperties({
- "uuid", "owner", "server", "resource_uri", "meta", "subscription",
- "tags", "nameservers", "netmask", "gateway"
- })
- public IPInfo(String uuid, Owner owner, Server server, URI resourceUri, Map<String, String> meta, Subscription subscription
- , List<Tag> tags, List<String> nameservers, int netmask, String gateway) {
- super(uuid, owner, server, resourceUri);
- this.meta = meta;
- this.subscription = subscription;
- this.tags = tags;
- this.nameservers = nameservers;
- this.netmask = netmask;
- this.gateway = gateway;
- }
-
- /**
- * @return User defined meta information
- */
- public Map<String, String> getMeta() {
- return meta;
- }
-
- /**
- * @return Subscription related to this VLAN
- */
- public Subscription getSubscription() {
- return subscription;
- }
-
- /**
- * @return Tags added to this VLAN
- */
- public List<Tag> getTags() {
- return tags;
- }
-
- /**
- * @return Servers added to this IP
- */
- public List<String> getNameservers() {
- return nameservers;
- }
-
- /**
- * @return IP netmask
- */
- public int getNetmask() {
- return netmask;
- }
-
- /**
- * @return getaway
- */
- public String getGateway() {
- return gateway;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (!(o instanceof IPInfo)) return false;
- if (!super.equals(o)) return false;
-
- IPInfo ipInfo = (IPInfo) o;
-
- if (netmask != ipInfo.netmask) return false;
- if (gateway != null ? !gateway.equals(ipInfo.gateway) : ipInfo.gateway != null) return false;
- if (meta != null ? !meta.equals(ipInfo.meta) : ipInfo.meta != null) return false;
- if (nameservers != null ? !nameservers.equals(ipInfo.nameservers) : ipInfo.nameservers != null) return false;
- if (subscription != null ? !subscription.equals(ipInfo.subscription) : ipInfo.subscription != null)
- return false;
- if (tags != null ? !tags.equals(ipInfo.tags) : ipInfo.tags != null) return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = super.hashCode();
- result = 31 * result + (meta != null ? meta.hashCode() : 0);
- result = 31 * result + (subscription != null ? subscription.hashCode() : 0);
- result = 31 * result + (tags != null ? tags.hashCode() : 0);
- result = 31 * result + (nameservers != null ? nameservers.hashCode() : 0);
- result = 31 * result + netmask;
- result = 31 * result + (gateway != null ? gateway.hashCode() : 0);
- return result;
- }
-
- @Override
- public String toString() {
- return "[" +
- "owner=" + owner +
- ", uuid='" + uuid + '\'' +
- ", server=" + server +
- ", resourceUri=" + resourceUri +
- ", meta=" + meta +
- ", subscription=" + subscription +
- ", tags=" + tags +
- ", nameservers=" + nameservers +
- ", netmask=" + netmask +
- ", gateway='" + gateway + '\'' +
- "]";
- }
+ public static class Builder extends IP.Builder {
+ private Map<String, String> meta;
+ private Subscription subscription;
+ private List<Tag> tags;
+ private List<String> nameservers;
+ private int netmask;
+ private String gateway;
+
+ /**
+ * @param meta User defined meta information
+ * @return IPInfo Builder
+ */
+ public Builder meta(Map<String, String> meta) {
+ this.meta = meta;
+ return this;
+ }
+
+ /**
+ * @param subscription Subscription related to this VLAN
+ * @return IPInfo Builder
+ */
+ public Builder subscription(Subscription subscription) {
+ this.subscription = subscription;
+ return this;
+ }
+
+ /**
+ * @param tags Tags added to this VLAN
+ * @return IPInfo Builder
+ */
+ public Builder tags(List<Tag> tags) {
+ this.tags = ImmutableList.copyOf(tags);
+ return this;
+ }
+
+ /**
+ * @param nameservers Servers added to this IP
+ * @return IPInfo Builder
+ */
+ public Builder nameservers(List<String> nameservers) {
+ this.nameservers = ImmutableList.copyOf(nameservers);
+ return this;
+ }
+
+ /**
+ * @param netmask IP netmask
+ * @return IPInfo Builder
+ */
+ public Builder netmask(int netmask) {
+ this.netmask = netmask;
+ return this;
+ }
+
+ /**
+ * @param gateway getaway
+ * @return IPInfo Builder
+ */
+ public Builder gateway(String gateway) {
+ this.gateway = gateway;
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @return IPInfo Builder
+ */
+ @Override
+ public Builder uuid(String uuid) {
+ return Builder.class.cast(super.uuid(uuid));
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @return IPInfo Builder
+ */
+ @Override
+ public Builder owner(Owner owner) {
+ return Builder.class.cast(super.owner(owner));
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @return IPInfo Builder
+ */
+ @Override
+ public Builder server(Server server) {
+ return Builder.class.cast(super.server(server));
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @return IPInfo Builder
+ */
+ @Override
+ public Builder resourceUri(URI resourceUri) {
+ return Builder.class.cast(super.resourceUri(resourceUri));
+ }
+
+ public IPInfo build() {
+ return new IPInfo(uuid, owner, server, resourceUri, meta, subscription, tags, nameservers, netmask, gateway);
+ }
+
+ public Builder fromIP(IP ip) {
+ return new Builder()
+ .uuid(ip.getUuid())
+ .owner(ip.getOwner())
+ .server(ip.getServer())
+ .resourceUri(ip.getResourceUri());
+ }
+ }
+
+ private final Map<String, String> meta;
+ private final Subscription subscription;
+ private final List<Tag> tags;
+ private final List<String> nameservers;
+ private final int netmask;
+ private final String gateway;
+
+ @ConstructorProperties({
+ "uuid", "owner", "server", "resource_uri", "meta", "subscription",
+ "tags", "nameservers", "netmask", "gateway"
+ })
+ public IPInfo(String uuid, Owner owner, Server server, URI resourceUri, Map<String, String> meta
+ , Subscription subscription, List<Tag> tags, List<String> nameservers, int netmask, String gateway) {
+ super(uuid, owner, server, resourceUri);
+ this.meta = meta;
+ this.subscription = subscription;
+ this.tags = tags;
+ this.nameservers = nameservers;
+ this.netmask = netmask;
+ this.gateway = gateway;
+ }
+
+ /**
+ * @return User defined meta information
+ */
+ public Map<String, String> getMeta() {
+ return meta;
+ }
+
+ /**
+ * @return Subscription related to this VLAN
+ */
+ public Subscription getSubscription() {
+ return subscription;
+ }
+
+ /**
+ * @return Tags added to this VLAN
+ */
+ public List<Tag> getTags() {
+ return tags;
+ }
+
+ /**
+ * @return Servers added to this IP
+ */
+ public List<String> getNameservers() {
+ return nameservers;
+ }
+
+ /**
+ * @return IP netmask
+ */
+ public int getNetmask() {
+ return netmask;
+ }
+
+ /**
+ * @return getaway
+ */
+ public String getGateway() {
+ return gateway;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (!(o instanceof IPInfo)) return false;
+ if (!super.equals(o)) return false;
+
+ IPInfo ipInfo = (IPInfo) o;
+
+ if (netmask != ipInfo.netmask) return false;
+ if (gateway != null ? !gateway.equals(ipInfo.gateway) : ipInfo.gateway != null) return false;
+ if (meta != null ? !meta.equals(ipInfo.meta) : ipInfo.meta != null) return false;
+ if (nameservers != null ? !nameservers.equals(ipInfo.nameservers) : ipInfo.nameservers != null) return false;
+ if (subscription != null ? !subscription.equals(ipInfo.subscription) : ipInfo.subscription != null)
+ return false;
+ if (tags != null ? !tags.equals(ipInfo.tags) : ipInfo.tags != null) return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = super.hashCode();
+ result = 31 * result + (meta != null ? meta.hashCode() : 0);
+ result = 31 * result + (subscription != null ? subscription.hashCode() : 0);
+ result = 31 * result + (tags != null ? tags.hashCode() : 0);
+ result = 31 * result + (nameservers != null ? nameservers.hashCode() : 0);
+ result = 31 * result + netmask;
+ result = 31 * result + (gateway != null ? gateway.hashCode() : 0);
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ return "[" +
+ "owner=" + owner +
+ ", uuid='" + uuid + '\'' +
+ ", server=" + server +
+ ", resourceUri=" + resourceUri +
+ ", meta=" + meta +
+ ", subscription=" + subscription +
+ ", tags=" + tags +
+ ", nameservers=" + nameservers +
+ ", netmask=" + netmask +
+ ", gateway='" + gateway + '\'' +
+ "]";
+ }
}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/0d70c84a/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/InterfaceType.java
----------------------------------------------------------------------
diff --git a/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/InterfaceType.java b/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/InterfaceType.java
index c3de2ce..cf7fcc5 100644
--- a/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/InterfaceType.java
+++ b/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/InterfaceType.java
@@ -22,22 +22,22 @@ import static com.google.common.base.Preconditions.checkNotNull;
* @author Vladimir Shevchenko
*/
public enum InterfaceType {
- PUBLIC, PRIVATE;
+ PUBLIC, PRIVATE;
- public String value() {
- return name().toLowerCase();
- }
+ public String value() {
+ return name().toLowerCase();
+ }
- @Override
- public String toString() {
- return value();
- }
+ @Override
+ public String toString() {
+ return value();
+ }
- public static InterfaceType fromValue(String type) {
- try {
- return valueOf(checkNotNull(type, "type").toUpperCase());
- } catch (IllegalArgumentException e) {
- return PUBLIC;
- }
- }
+ public static InterfaceType fromValue(String type) {
+ try {
+ return valueOf(checkNotNull(type, "type").toUpperCase());
+ } catch (IllegalArgumentException e) {
+ return PUBLIC;
+ }
+ }
}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/0d70c84a/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/Item.java
----------------------------------------------------------------------
diff --git a/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/Item.java b/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/Item.java
index 554056c..1299c23 100644
--- a/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/Item.java
+++ b/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/Item.java
@@ -26,150 +26,148 @@ import java.net.URI;
* @author Vladimir Shevchenko
*/
public class Item {
- public static class Builder {
- protected String uuid;
- protected String name;
- protected URI resourceUri;
-
- public Builder uuid(String uuid) {
- this.uuid = uuid;
- return this;
- }
-
- public Builder name(String name) {
- this.name = name;
- return this;
- }
-
- public Builder resourceUri(URI resourceUri) {
- this.resourceUri = resourceUri;
- return this;
- }
-
- public Item build() {
- return new Item(uuid, name, resourceUri);
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((name == null) ? 0 : name.hashCode());
- result = prime * result + ((uuid == null) ? 0 : uuid.hashCode());
- result = prime * result + ((resourceUri == null) ? 0 : resourceUri.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- Builder other = (Builder) obj;
- if (name == null) {
- if (other.name != null)
- return false;
- } else if (!name.equals(other.name))
- return false;
- if (uuid == null) {
- if (other.uuid != null)
- return false;
- } else if (!uuid.equals(other.uuid))
- return false;
- if (resourceUri == null) {
- if (other.resourceUri != null)
- return false;
- } else if (!resourceUri.equals(other.resourceUri))
- return false;
+ public static class Builder {
+ protected String uuid;
+ protected String name;
+ protected URI resourceUri;
+
+ public Builder uuid(String uuid) {
+ this.uuid = uuid;
+ return this;
+ }
+
+ public Builder name(String name) {
+ this.name = name;
+ return this;
+ }
+
+ public Builder resourceUri(URI resourceUri) {
+ this.resourceUri = resourceUri;
+ return this;
+ }
+
+ public Item build() {
+ return new Item(uuid, name, resourceUri);
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ result = prime * result + ((uuid == null) ? 0 : uuid.hashCode());
+ result = prime * result + ((resourceUri == null) ? 0 : resourceUri.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
return true;
- }
- }
-
- @Nullable
- protected final String uuid;
- @Nullable
- protected final String name;
- @Nullable
- @Named("resource_uri")
- protected final URI resourceUri;
-
- @ConstructorProperties({
- "uuid", "name", "resource_uri"
- })
- public Item(@Nullable String uuid, @Nullable String name, @Nullable URI resourceUri) {
- this.uuid = uuid;
- this.name = name;
- this.resourceUri = resourceUri;
- }
-
- /**
- *
- * @return uuid of the item.
- */
- @Nullable
- public String getUuid() {
- return uuid;
- }
-
- /**
- * @return Human readable name
- */
- public String getName() {
- return name;
- }
-
- /**
- *
- * @return Unicode string data.
- */
- @Nullable
- public URI getResourceUri() {
- return resourceUri;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((name == null) ? 0 : name.hashCode());
- return result;
- }
-
- @Override
-
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
+ if (obj == null)
return false;
- if (getClass() != obj.getClass())
+ if (getClass() != obj.getClass())
return false;
- Item other = (Item) obj;
- if (name == null) {
+ Builder other = (Builder) obj;
+ if (name == null) {
if (other.name != null)
- return false;
- } else if (!name.equals(other.name))
+ return false;
+ } else if (!name.equals(other.name))
return false;
- if (uuid == null) {
+ if (uuid == null) {
if (other.uuid != null)
- return false;
- } else if (!uuid.equals(other.uuid))
+ return false;
+ } else if (!uuid.equals(other.uuid))
return false;
- if (resourceUri == null) {
+ if (resourceUri == null) {
if (other.resourceUri != null)
- return false;
- } else if (!resourceUri.equals(other.resourceUri))
+ return false;
+ } else if (!resourceUri.equals(other.resourceUri))
+ return false;
+ return true;
+ }
+ }
+
+ @Nullable
+ protected final String uuid;
+ @Nullable
+ protected final String name;
+ @Nullable
+ @Named("resource_uri")
+ protected final URI resourceUri;
+
+ @ConstructorProperties({
+ "uuid", "name", "resource_uri"
+ })
+ public Item(@Nullable String uuid, @Nullable String name, @Nullable URI resourceUri) {
+ this.uuid = uuid;
+ this.name = name;
+ this.resourceUri = resourceUri;
+ }
+
+ /**
+ * @return uuid of the item.
+ */
+ @Nullable
+ public String getUuid() {
+ return uuid;
+ }
+
+ /**
+ * @return Human readable name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @return Unicode string data.
+ */
+ @Nullable
+ public URI getResourceUri() {
+ return resourceUri;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ return result;
+ }
+
+ @Override
+
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ Item other = (Item) obj;
+ if (name == null) {
+ if (other.name != null)
+ return false;
+ } else if (!name.equals(other.name))
+ return false;
+ if (uuid == null) {
+ if (other.uuid != null)
+ return false;
+ } else if (!uuid.equals(other.uuid))
+ return false;
+ if (resourceUri == null) {
+ if (other.resourceUri != null)
return false;
+ } else if (!resourceUri.equals(other.resourceUri))
+ return false;
- return true;
- }
+ return true;
+ }
- @Override
+ @Override
- public String toString() {
- return "[uuid=" + uuid + ", name=" + name + ", resourceUri=" + resourceUri + "]";
- }
+ public String toString() {
+ return "[uuid=" + uuid + ", name=" + name + ", resourceUri=" + resourceUri + "]";
+ }
}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/0d70c84a/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/LibraryDrive.java
----------------------------------------------------------------------
diff --git a/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/LibraryDrive.java b/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/LibraryDrive.java
index c233650..90f1864 100644
--- a/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/LibraryDrive.java
+++ b/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/LibraryDrive.java
@@ -30,347 +30,357 @@ import java.util.Map;
*/
public class LibraryDrive extends DriveInfo {
- public static class Builder extends DriveInfo.Builder{
- private String arch;
- private List<String> category;
- private String description;
- private boolean isFavorite;
- private String imageType;
- private String installNotes;
- private String os;
- private boolean isPaid;
- private String url;
-
- public Builder arch(String arch){
- this.arch = arch;
- return this;
- }
-
- public Builder category(List<String> category){
- this.category = ImmutableList.copyOf(category);
- return this;
- }
-
- public Builder description(String description){
- this.description = description;
- return this;
- }
-
- public Builder isFavorite(boolean isFavorite){
- this.isFavorite = isFavorite;
- return this;
- }
-
- public Builder imageType(String imageType){
- this.imageType = imageType;
- return this;
- }
-
- public Builder installNotes(String installNotes){
- this.installNotes = installNotes;
- return this;
- }
-
- public Builder isPaid(boolean isPaid){
- this.isPaid = isPaid;
- return this;
- }
-
- public Builder os(String os){
- this.os = os;
- return this;
- }
-
- public Builder url(String url){
- this.url = url;
- return this;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder size(BigInteger size) {
- this.size = size;
- return this;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder allowMultimount(boolean allowMultimount) {
- this.allowMultimount = allowMultimount;
- return this;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder affinities(List<String> affinities) {
- this.affinities = ImmutableList.copyOf(affinities);
- return this;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder jobs(List<String> jobs) {
- this.jobs = ImmutableList.copyOf(jobs);
- return this;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder licenses(List<DriveLicense> licenses) {
- this.licenses = licenses;
- return this;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder media(MediaType media) {
- this.media = media;
- return this;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder meta(Map<String,String> meta) {
- this.meta = meta;
- return this;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder mountedOn(List<Server> mountedOn) {
- this.mountedOn = ImmutableList.copyOf(mountedOn);
- return this;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder tags(List<String> tags) {
- this.tags = ImmutableList.copyOf(tags);
- return this;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder uuid(String uuid) {
- return Builder.class.cast(super.uuid(uuid));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder name(String name) {
- return Builder.class.cast(super.name(name));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder resourceUri(URI resourceUri) {
- return Builder.class.cast(super.resourceUri(resourceUri));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder owner(Owner owner) {
- return Builder.class.cast(super.owner(owner));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder status(DriveStatus status) {
- return Builder.class.cast(super.status(status));
- }
-
- public static Builder fromDriveInfo(DriveInfo in) {
- return new Builder().uuid(in.getUuid()).name(in.getName()).resourceUri(in.getResourceUri())
- .owner(in.getOwner()).status(in.getStatus()).size(in.getSize())
- .allowMultimount(in.isAllowMultimount()).affinities(in.getAffinities()).jobs(in.getJobs())
- .licenses(in.getLicenses()).media(in.getMedia()).meta(in.getMeta()).mountedOn(in.getMountedOn())
- .tags(in.getTags());
- }
-
- public LibraryDrive build(){
- return new LibraryDrive(uuid, name, resourceUri, size, owner, status, allowMultimount, affinities, jobs, licenses
- , media, meta, mountedOn, tags, arch, category, description, isFavorite, imageType, installNotes, os
- , isPaid, url);
- }
- }
-
- private final String arch;
- private final List<String> category;
- private final String description;
- @Named("favourite")
- private final boolean isFavorite;
- @Named("image_type")
- private final String imageType;
- @Named("install_notes")
- private final String installNotes;
- private final String os;
- @Named("paid")
- private final boolean isPaid;
- private final String url;
-
- @ConstructorProperties({
- "uuid", "name", "resource_uri", "size", "owner", "status",
- "allow_multimount", "affinities", "jobs", "licenses",
- "media", "meta", "mounted_on", "tags", "arch", "category",
- "description", "favourite", "image_type", "install_notes", "os", "paid", "url"
- })
- public LibraryDrive(String uuid, String name, URI resourceUri, BigInteger size, Owner owner, DriveStatus status
- , boolean allowMultimount, List<String> affinities, List<String> jobs, List<DriveLicense> licenses
- , MediaType media, Map<String,String> meta, List<Server> mountedOn, List<String> tags, String arch, List<String> category
- , String description, boolean favorite, String imageType, String installNotes, String os, boolean paid, String url) {
- super(uuid, name, resourceUri, size, owner, status, allowMultimount, affinities, jobs, licenses, media, meta, mountedOn, tags);
- this.arch = arch;
- this.category = category;
- this.description = description;
- this.isFavorite = favorite;
- this.imageType = imageType;
- this.installNotes = installNotes;
- this.os = os;
- this.isPaid = paid;
- this.url = url;
- }
-
- /**
- * @return Operating system bit architecture the drive.
- */
- public String getArch() {
- return arch;
- }
-
- /**
- * @return Category of the drive.
- */
- public List<String> getCategory() {
- return category;
- }
-
- /**
- * @return Description of drive image.
- */
- public String getDescription() {
- return description;
- }
-
- /**
- * @return Type of drive image
- */
- public String getImageType() {
- return imageType;
- }
-
- /**
- * @return Install notes for the drive image.
- */
- public String getInstallNotes() {
- return installNotes;
- }
-
- /**
- * @return Favourite drive image for user.
- */
- public boolean isFavorite() {
- return isFavorite;
- }
-
- /**
- * @return Paid or free.
- */
- public boolean isPaid() {
- return isPaid;
- }
-
- /**
- * @return Operating system of the drive.
- */
- public String getOs() {
- return os;
- }
-
- /**
- * @return Operating system bit architecture the drive.
- */
- public String getUrl() {
- return url;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (!(o instanceof LibraryDrive)) return false;
- if (!super.equals(o)) return false;
-
- LibraryDrive that = (LibraryDrive) o;
-
- if (isFavorite != that.isFavorite) return false;
- if (isPaid != that.isPaid) return false;
- if (arch != null ? !arch.equals(that.arch) : that.arch != null) return false;
- if (category != null ? !category.equals(that.category) : that.category != null) return false;
- if (description != null ? !description.equals(that.description) : that.description != null) return false;
- if (imageType != null ? !imageType.equals(that.imageType) : that.imageType != null) return false;
- if (installNotes != null ? !installNotes.equals(that.installNotes) : that.installNotes != null) return false;
- if (os != null ? !os.equals(that.os) : that.os != null) return false;
- if (url != null ? !url.equals(that.url) : that.url != null) return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = super.hashCode();
- result = 31 * result + (arch != null ? arch.hashCode() : 0);
- result = 31 * result + (category != null ? category.hashCode() : 0);
- result = 31 * result + (description != null ? description.hashCode() : 0);
- result = 31 * result + (isFavorite ? 1 : 0);
- result = 31 * result + (imageType != null ? imageType.hashCode() : 0);
- result = 31 * result + (installNotes != null ? installNotes.hashCode() : 0);
- result = 31 * result + (os != null ? os.hashCode() : 0);
- result = 31 * result + (isPaid ? 1 : 0);
- result = 31 * result + (url != null ? url.hashCode() : 0);
- return result;
- }
-
- @Override
- public String toString() {
- return "[uuid=" + uuid + ", name=" + name + ", size=" + size + ", owner=" + owner + ", status=" + status
- + ", affinities=" + affinities + ", jobs=" + jobs + ", licenses=" + licenses + ", media=" + media
- + ", meta=" + meta + ", mountedOn=" + mountedOn + ", tags=" + tags +
- ", arch='" + arch + '\'' +
- ", category=" + category +
- ", description='" + description + '\'' +
- ", isFavorite=" + isFavorite +
- ", imageType='" + imageType + '\'' +
- ", installNotes='" + installNotes + '\'' +
- ", os='" + os + '\'' +
- ", isPaid=" + isPaid +
- ", url='" + url + '\'' +
- "]";
- }
+ public static class Builder extends DriveInfo.Builder {
+ private String arch;
+ private List<String> category;
+ private String description;
+ private boolean isFavorite;
+ private String imageType;
+ private String installNotes;
+ private String os;
+ private boolean isPaid;
+ private String url;
+
+ public Builder arch(String arch) {
+ this.arch = arch;
+ return this;
+ }
+
+ public Builder category(List<String> category) {
+ this.category = ImmutableList.copyOf(category);
+ return this;
+ }
+
+ public Builder description(String description) {
+ this.description = description;
+ return this;
+ }
+
+ public Builder isFavorite(boolean isFavorite) {
+ this.isFavorite = isFavorite;
+ return this;
+ }
+
+ public Builder imageType(String imageType) {
+ this.imageType = imageType;
+ return this;
+ }
+
+ public Builder installNotes(String installNotes) {
+ this.installNotes = installNotes;
+ return this;
+ }
+
+ public Builder isPaid(boolean isPaid) {
+ this.isPaid = isPaid;
+ return this;
+ }
+
+ public Builder os(String os) {
+ this.os = os;
+ return this;
+ }
+
+ public Builder url(String url) {
+ this.url = url;
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Builder size(BigInteger size) {
+ this.size = size;
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Builder allowMultimount(boolean allowMultimount) {
+ this.allowMultimount = allowMultimount;
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Builder affinities(List<String> affinities) {
+ this.affinities = ImmutableList.copyOf(affinities);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Builder jobs(List<String> jobs) {
+ this.jobs = ImmutableList.copyOf(jobs);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Builder licenses(List<DriveLicense> licenses) {
+ this.licenses = licenses;
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Builder media(MediaType media) {
+ this.media = media;
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Builder meta(Map<String, String> meta) {
+ this.meta = meta;
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Builder mountedOn(List<Server> mountedOn) {
+ this.mountedOn = ImmutableList.copyOf(mountedOn);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Builder tags(List<String> tags) {
+ this.tags = ImmutableList.copyOf(tags);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Builder uuid(String uuid) {
+ return Builder.class.cast(super.uuid(uuid));
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Builder name(String name) {
+ return Builder.class.cast(super.name(name));
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Builder resourceUri(URI resourceUri) {
+ return Builder.class.cast(super.resourceUri(resourceUri));
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Builder owner(Owner owner) {
+ return Builder.class.cast(super.owner(owner));
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Builder status(DriveStatus status) {
+ return Builder.class.cast(super.status(status));
+ }
+
+ public static Builder fromDriveInfo(DriveInfo in) {
+ return new Builder()
+ .uuid(in.getUuid())
+ .name(in.getName())
+ .resourceUri(in.getResourceUri())
+ .owner(in.getOwner())
+ .status(in.getStatus())
+ .size(in.getSize())
+ .allowMultimount(in.isAllowMultimount())
+ .affinities(in.getAffinities())
+ .jobs(in.getJobs())
+ .licenses(in.getLicenses())
+ .media(in.getMedia())
+ .meta(in.getMeta())
+ .mountedOn(in.getMountedOn())
+ .tags(in.getTags());
+ }
+
+ public LibraryDrive build() {
+ return new LibraryDrive(uuid, name, resourceUri, size, owner, status, allowMultimount, affinities, jobs
+ , licenses, media, meta, mountedOn, tags, arch, category, description, isFavorite, imageType
+ , installNotes, os, isPaid, url);
+ }
+ }
+
+ private final String arch;
+ private final List<String> category;
+ private final String description;
+ @Named("favourite")
+ private final boolean isFavorite;
+ @Named("image_type")
+ private final String imageType;
+ @Named("install_notes")
+ private final String installNotes;
+ private final String os;
+ @Named("paid")
+ private final boolean isPaid;
+ private final String url;
+
+ @ConstructorProperties({
+ "uuid", "name", "resource_uri", "size", "owner", "status",
+ "allow_multimount", "affinities", "jobs", "licenses",
+ "media", "meta", "mounted_on", "tags", "arch", "category",
+ "description", "favourite", "image_type", "install_notes", "os", "paid", "url"
+ })
+ public LibraryDrive(String uuid, String name, URI resourceUri, BigInteger size, Owner owner, DriveStatus status
+ , boolean allowMultimount, List<String> affinities, List<String> jobs, List<DriveLicense> licenses
+ , MediaType media, Map<String, String> meta, List<Server> mountedOn, List<String> tags, String arch, List<String> category
+ , String description, boolean favorite, String imageType, String installNotes, String os, boolean paid, String url) {
+ super(uuid, name, resourceUri, size, owner, status, allowMultimount, affinities, jobs, licenses, media, meta, mountedOn, tags);
+ this.arch = arch;
+ this.category = category;
+ this.description = description;
+ this.isFavorite = favorite;
+ this.imageType = imageType;
+ this.installNotes = installNotes;
+ this.os = os;
+ this.isPaid = paid;
+ this.url = url;
+ }
+
+ /**
+ * @return Operating system bit architecture the drive.
+ */
+ public String getArch() {
+ return arch;
+ }
+
+ /**
+ * @return Category of the drive.
+ */
+ public List<String> getCategory() {
+ return category;
+ }
+
+ /**
+ * @return Description of drive image.
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * @return Type of drive image
+ */
+ public String getImageType() {
+ return imageType;
+ }
+
+ /**
+ * @return Install notes for the drive image.
+ */
+ public String getInstallNotes() {
+ return installNotes;
+ }
+
+ /**
+ * @return Favourite drive image for user.
+ */
+ public boolean isFavorite() {
+ return isFavorite;
+ }
+
+ /**
+ * @return Paid or free.
+ */
+ public boolean isPaid() {
+ return isPaid;
+ }
+
+ /**
+ * @return Operating system of the drive.
+ */
+ public String getOs() {
+ return os;
+ }
+
+ /**
+ * @return Operating system bit architecture the drive.
+ */
+ public String getUrl() {
+ return url;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (!(o instanceof LibraryDrive)) return false;
+ if (!super.equals(o)) return false;
+
+ LibraryDrive that = (LibraryDrive) o;
+
+ if (isFavorite != that.isFavorite) return false;
+ if (isPaid != that.isPaid) return false;
+ if (arch != null ? !arch.equals(that.arch) : that.arch != null) return false;
+ if (category != null ? !category.equals(that.category) : that.category != null) return false;
+ if (description != null ? !description.equals(that.description) : that.description != null) return false;
+ if (imageType != null ? !imageType.equals(that.imageType) : that.imageType != null) return false;
+ if (installNotes != null ? !installNotes.equals(that.installNotes) : that.installNotes != null) return false;
+ if (os != null ? !os.equals(that.os) : that.os != null) return false;
+ if (url != null ? !url.equals(that.url) : that.url != null) return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = super.hashCode();
+ result = 31 * result + (arch != null ? arch.hashCode() : 0);
+ result = 31 * result + (category != null ? category.hashCode() : 0);
+ result = 31 * result + (description != null ? description.hashCode() : 0);
+ result = 31 * result + (isFavorite ? 1 : 0);
+ result = 31 * result + (imageType != null ? imageType.hashCode() : 0);
+ result = 31 * result + (installNotes != null ? installNotes.hashCode() : 0);
+ result = 31 * result + (os != null ? os.hashCode() : 0);
+ result = 31 * result + (isPaid ? 1 : 0);
+ result = 31 * result + (url != null ? url.hashCode() : 0);
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ return "[uuid=" + uuid + ", name=" + name + ", size=" + size + ", owner=" + owner + ", status=" + status
+ + ", affinities=" + affinities + ", jobs=" + jobs + ", licenses=" + licenses + ", media=" + media
+ + ", meta=" + meta + ", mountedOn=" + mountedOn + ", tags=" + tags +
+ ", arch='" + arch + '\'' +
+ ", category=" + category +
+ ", description='" + description + '\'' +
+ ", isFavorite=" + isFavorite +
+ ", imageType='" + imageType + '\'' +
+ ", installNotes='" + installNotes + '\'' +
+ ", os='" + os + '\'' +
+ ", isPaid=" + isPaid +
+ ", url='" + url + '\'' +
+ "]";
+ }
}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/0d70c84a/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/License.java
----------------------------------------------------------------------
diff --git a/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/License.java b/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/License.java
index e5c9f51..13c7e30 100644
--- a/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/License.java
+++ b/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/License.java
@@ -25,150 +25,150 @@ import java.net.URI;
*/
public class License {
- public static class Builder{
- private boolean burstable;
- private String longName;
- private String name;
- private URI resourceUri;
- private String type;
- private String userMetric;
-
- public Builder isBurstable(boolean burstable){
- this.burstable = burstable;
- return this;
- }
-
- public Builder longName(String longName){
- this.longName = longName;
- return this;
- }
-
- public Builder name(String name){
- this.name = name;
- return this;
- }
-
- public Builder resourceUri(URI resourceUri){
- this.resourceUri = resourceUri;
- return this;
- }
-
- public Builder type(String type){
- this.type = type;
- return this;
- }
-
- public Builder userMetric(String userMetric){
- this.userMetric = userMetric;
- return this;
- }
-
- public License build(){
- return new License(burstable, longName, name, resourceUri, type, userMetric);
- }
- }
-
- private final boolean burstable;
- @Named("long_name")
- private final String longName;
- private final String name;
- @Named("resource_uri")
- private final URI resourceUri;
- private final String type;
- @Named("user_metric")
- private final String userMetric;
-
- @ConstructorProperties({
- "burstable", "long_name", "name", "resource_uri", "type", "user_metric"
- })
- public License(boolean burstable, String longName, String name, URI resourceUri, String type, String userMetric) {
- this.burstable = burstable;
- this.longName = longName;
- this.name = name;
- this.resourceUri = resourceUri;
- this.type = type;
- this.userMetric = userMetric;
- }
-
- /**
- * @return Whether this resource can be used on burst
- */
- public boolean isBurstable() {
- return burstable;
- }
-
- /**
- * @return A human readable name for the resource.
- */
- public String getLongName() {
- return longName;
- }
-
- /**
- * @return Name that should be used when purchasing
- */
- public String getName() {
- return name;
- }
-
- /**
- * @return Unique resource uri
- */
- public URI getResourceUri() {
- return resourceUri;
- }
-
- /**
- * @return Type of billing
- */
- public String getType() {
- return type;
- }
-
- /**
- * @return The metric that the user is charged for
- */
- public String getUserMetric() {
- return userMetric;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (!(o instanceof License)) return false;
-
- License that = (License) o;
-
- if (burstable != that.burstable) return false;
- if (longName != null ? !longName.equals(that.longName) : that.longName != null) return false;
- if (name != null ? !name.equals(that.name) : that.name != null) return false;
- if (resourceUri != null ? !resourceUri.equals(that.resourceUri) : that.resourceUri != null) return false;
- if (type != null ? !type.equals(that.type) : that.type != null) return false;
- if (userMetric != null ? !userMetric.equals(that.userMetric) : that.userMetric != null) return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = (burstable ? 1 : 0);
- result = 31 * result + (longName != null ? longName.hashCode() : 0);
- result = 31 * result + (name != null ? name.hashCode() : 0);
- result = 31 * result + (resourceUri != null ? resourceUri.hashCode() : 0);
- result = 31 * result + (type != null ? type.hashCode() : 0);
- result = 31 * result + (userMetric != null ? userMetric.hashCode() : 0);
- return result;
- }
-
- @Override
- public String toString() {
- return "[" +
- "burstable=" + burstable +
- ", longName='" + longName + '\'' +
- ", name='" + name + '\'' +
- ", resourceUri='" + resourceUri + '\'' +
- ", type='" + type + '\'' +
- ", userMetric='" + userMetric + '\'' +
- "]";
- }
+ public static class Builder {
+ private boolean burstable;
+ private String longName;
+ private String name;
+ private URI resourceUri;
+ private String type;
+ private String userMetric;
+
+ public Builder isBurstable(boolean burstable) {
+ this.burstable = burstable;
+ return this;
+ }
+
+ public Builder longName(String longName) {
+ this.longName = longName;
+ return this;
+ }
+
+ public Builder name(String name) {
+ this.name = name;
+ return this;
+ }
+
+ public Builder resourceUri(URI resourceUri) {
+ this.resourceUri = resourceUri;
+ return this;
+ }
+
+ public Builder type(String type) {
+ this.type = type;
+ return this;
+ }
+
+ public Builder userMetric(String userMetric) {
+ this.userMetric = userMetric;
+ return this;
+ }
+
+ public License build() {
+ return new License(burstable, longName, name, resourceUri, type, userMetric);
+ }
+ }
+
+ private final boolean burstable;
+ @Named("long_name")
+ private final String longName;
+ private final String name;
+ @Named("resource_uri")
+ private final URI resourceUri;
+ private final String type;
+ @Named("user_metric")
+ private final String userMetric;
+
+ @ConstructorProperties({
+ "burstable", "long_name", "name", "resource_uri", "type", "user_metric"
+ })
+ public License(boolean burstable, String longName, String name, URI resourceUri, String type, String userMetric) {
+ this.burstable = burstable;
+ this.longName = longName;
+ this.name = name;
+ this.resourceUri = resourceUri;
+ this.type = type;
+ this.userMetric = userMetric;
+ }
+
+ /**
+ * @return Whether this resource can be used on burst
+ */
+ public boolean isBurstable() {
+ return burstable;
+ }
+
+ /**
+ * @return A human readable name for the resource.
+ */
+ public String getLongName() {
+ return longName;
+ }
+
+ /**
+ * @return Name that should be used when purchasing
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @return Unique resource uri
+ */
+ public URI getResourceUri() {
+ return resourceUri;
+ }
+
+ /**
+ * @return Type of billing
+ */
+ public String getType() {
+ return type;
+ }
+
+ /**
+ * @return The metric that the user is charged for
+ */
+ public String getUserMetric() {
+ return userMetric;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (!(o instanceof License)) return false;
+
+ License that = (License) o;
+
+ if (burstable != that.burstable) return false;
+ if (longName != null ? !longName.equals(that.longName) : that.longName != null) return false;
+ if (name != null ? !name.equals(that.name) : that.name != null) return false;
+ if (resourceUri != null ? !resourceUri.equals(that.resourceUri) : that.resourceUri != null) return false;
+ if (type != null ? !type.equals(that.type) : that.type != null) return false;
+ if (userMetric != null ? !userMetric.equals(that.userMetric) : that.userMetric != null) return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = (burstable ? 1 : 0);
+ result = 31 * result + (longName != null ? longName.hashCode() : 0);
+ result = 31 * result + (name != null ? name.hashCode() : 0);
+ result = 31 * result + (resourceUri != null ? resourceUri.hashCode() : 0);
+ result = 31 * result + (type != null ? type.hashCode() : 0);
+ result = 31 * result + (userMetric != null ? userMetric.hashCode() : 0);
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ return "[" +
+ "burstable=" + burstable +
+ ", longName='" + longName + '\'' +
+ ", name='" + name + '\'' +
+ ", resourceUri='" + resourceUri + '\'' +
+ ", type='" + type + '\'' +
+ ", userMetric='" + userMetric + '\'' +
+ "]";
+ }
}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/0d70c84a/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/MediaType.java
----------------------------------------------------------------------
diff --git a/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/MediaType.java b/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/MediaType.java
index 9b66cfd..0d2432d 100644
--- a/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/MediaType.java
+++ b/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/MediaType.java
@@ -21,7 +21,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
/**
* Media type - set to 'cdrom' to simulate a cdrom, set to 'disk' or leave unset to simulate a hard
* disk.
- *
+ *
* @author Adrian Cole
*/
public enum MediaType {
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/0d70c84a/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/Model.java
----------------------------------------------------------------------
diff --git a/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/Model.java b/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/Model.java
index 44ff213..70f2e1c 100644
--- a/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/Model.java
+++ b/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/Model.java
@@ -19,7 +19,6 @@ package org.jclouds.cloudsigma2.domain;
import static com.google.common.base.Preconditions.checkNotNull;
/**
- *
* @author Adrian Cole
*/
public enum Model {
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/0d70c84a/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/NIC.java
----------------------------------------------------------------------
diff --git a/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/NIC.java b/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/NIC.java
index 2fb7528..3a6846d 100644
--- a/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/NIC.java
+++ b/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/NIC.java
@@ -23,204 +23,204 @@ import java.beans.ConstructorProperties;
* @author Vladimir Shevchenko
*/
public class NIC {
- public static class Builder {
- private int bootOrder;
- private FirewallPolicy firewallPolicy;
- private IPConfiguration ipV4Configuration;
- private IPConfiguration ipV6Configuration;
- private String mac;
- private Model model;
- private NICStats runtime;
- private VLANInfo vlan;
-
- public Builder bootOrder(int bootOrder) {
- this.bootOrder = bootOrder;
- return this;
- }
-
- public Builder model(Model model) {
- this.model = model;
- return this;
- }
-
- public Builder vlan(VLANInfo vlan) {
- this.vlan = vlan;
- return this;
- }
-
- public Builder mac(String mac) {
- this.mac = mac;
- return this;
- }
-
- public Builder runtime(NICStats runtime) {
- this.runtime = runtime;
- return this;
- }
-
- public Builder firewallPolicy(FirewallPolicy firewallPolicy) {
- this.firewallPolicy = firewallPolicy;
- return this;
- }
-
- public Builder ipV4Configuration(IPConfiguration ipV4Configuration) {
- this.ipV4Configuration = ipV4Configuration;
- return this;
- }
-
- public Builder ipV6Configuration(IPConfiguration ipV6Configuration) {
- this.ipV6Configuration = ipV6Configuration;
- return this;
- }
-
- public NIC build() {
- return new NIC(bootOrder, firewallPolicy, ipV4Configuration, ipV6Configuration, mac, model, runtime, vlan);
- }
-
- public Builder fromNIC(NIC nic){
- return new Builder()
- .bootOrder(nic.getBootOrder())
- .firewallPolicy(nic.getFirewallPolicy())
- .ipV4Configuration(nic.getIpV4Configuration())
- .ipV6Configuration(nic.getIpV6Configuration())
- .mac(nic.getMac())
- .model(nic.getModel())
- .runtime(nic.getRuntime())
- .vlan(nic.getVlan());
- }
- }
-
- @Named("boot_order")
- private final int bootOrder;
- @Named("firewall_policy")
- private final FirewallPolicy firewallPolicy;
- @Named("ip_v4_conf")
- private final IPConfiguration ipV4Configuration;
- @Named("ip_v6_conf")
- private final IPConfiguration ipV6Configuration;
- private final String mac;
- private final Model model;
- private final NICStats runtime;
- private final VLANInfo vlan;
-
- @ConstructorProperties({
- "boot_order", "firewall_policy", "ip_v4_conf", "ip_v6_conf",
- "mac", "model", "runtime", "vlan"
- })
- public NIC(int bootOrder, FirewallPolicy firewallPolicy, IPConfiguration ipV4Configuration, IPConfiguration ipV6Configuration
- , String mac, Model model, NICStats runtime, VLANInfo vlan) {
- this.bootOrder = bootOrder;
- this.firewallPolicy = firewallPolicy;
- this.ipV4Configuration = ipV4Configuration;
- this.ipV6Configuration = ipV6Configuration;
- this.mac = mac;
- this.model = model;
- this.runtime = runtime;
- this.vlan = vlan;
- }
-
- /**
- * @return Model of NIC.
- */
- public Model getModel() {
- return model;
- }
-
- /**
- * @return UUID of the private VLAN.
- */
- public VLANInfo getVlan() {
- return vlan;
- }
-
- /**
- * @return MAC address of the server NIC.
- */
- public String getMac() {
- return mac;
- }
-
- /**
- * @return Device boot order.
- */
- public int getBootOrder() {
- return bootOrder;
- }
-
- /**
- * @return Public IPv4 configuration.
- */
- public IPConfiguration getIpV4Configuration() {
- return ipV4Configuration;
- }
-
- /**
- * @return Public IPv6 configuration.
- */
- public IPConfiguration getIpV6Configuration() {
- return ipV6Configuration;
- }
-
- /**
- * @return Firewall policy
- */
- public FirewallPolicy getFirewallPolicy() {
- return firewallPolicy;
- }
-
- /**
- * @return NIC runtime information
- */
- public NICStats getRuntime() {
- return runtime;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (!(o instanceof NIC)) return false;
-
- NIC nic = (NIC) o;
-
- if (bootOrder != nic.bootOrder) return false;
- if (firewallPolicy != null ? !firewallPolicy.equals(nic.firewallPolicy) : nic.firewallPolicy != null)
- return false;
- if (ipV4Configuration != null ? !ipV4Configuration.equals(nic.ipV4Configuration) : nic.ipV4Configuration != null)
- return false;
- if (ipV6Configuration != null ? !ipV6Configuration.equals(nic.ipV6Configuration) : nic.ipV6Configuration != null)
- return false;
- if (mac != null ? !mac.equals(nic.mac) : nic.mac != null) return false;
- if (model != nic.model) return false;
- if (runtime != null ? !runtime.equals(nic.runtime) : nic.runtime != null) return false;
- if (vlan != null ? !vlan.equals(nic.vlan) : nic.vlan != null) return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = bootOrder;
- result = 31 * result + (firewallPolicy != null ? firewallPolicy.hashCode() : 0);
- result = 31 * result + (ipV4Configuration != null ? ipV4Configuration.hashCode() : 0);
- result = 31 * result + (ipV6Configuration != null ? ipV6Configuration.hashCode() : 0);
- result = 31 * result + (mac != null ? mac.hashCode() : 0);
- result = 31 * result + (model != null ? model.hashCode() : 0);
- result = 31 * result + (runtime != null ? runtime.hashCode() : 0);
- result = 31 * result + (vlan != null ? vlan.hashCode() : 0);
- return result;
- }
-
- @Override
- public String toString() {
- return "[" +
- "bootOrder=" + bootOrder +
- ", firewallPolicy='" + firewallPolicy + '\'' +
- ", ipV4Configuration=" + ipV4Configuration +
- ", ipV6Configuration=" + ipV6Configuration +
- ", mac='" + mac + '\'' +
- ", model=" + model +
- ", runtime=" + runtime +
- ", vlan='" + vlan + '\'' +
- "]";
- }
+ public static class Builder {
+ private int bootOrder;
+ private FirewallPolicy firewallPolicy;
+ private IPConfiguration ipV4Configuration;
+ private IPConfiguration ipV6Configuration;
+ private String mac;
+ private Model model;
+ private NICStats runtime;
+ private VLANInfo vlan;
+
+ public Builder bootOrder(int bootOrder) {
+ this.bootOrder = bootOrder;
+ return this;
+ }
+
+ public Builder model(Model model) {
+ this.model = model;
+ return this;
+ }
+
+ public Builder vlan(VLANInfo vlan) {
+ this.vlan = vlan;
+ return this;
+ }
+
+ public Builder mac(String mac) {
+ this.mac = mac;
+ return this;
+ }
+
+ public Builder runtime(NICStats runtime) {
+ this.runtime = runtime;
+ return this;
+ }
+
+ public Builder firewallPolicy(FirewallPolicy firewallPolicy) {
+ this.firewallPolicy = firewallPolicy;
+ return this;
+ }
+
+ public Builder ipV4Configuration(IPConfiguration ipV4Configuration) {
+ this.ipV4Configuration = ipV4Configuration;
+ return this;
+ }
+
+ public Builder ipV6Configuration(IPConfiguration ipV6Configuration) {
+ this.ipV6Configuration = ipV6Configuration;
+ return this;
+ }
+
+ public NIC build() {
+ return new NIC(bootOrder, firewallPolicy, ipV4Configuration, ipV6Configuration, mac, model, runtime, vlan);
+ }
+
+ public Builder fromNIC(NIC nic) {
+ return new Builder()
+ .bootOrder(nic.getBootOrder())
+ .firewallPolicy(nic.getFirewallPolicy())
+ .ipV4Configuration(nic.getIpV4Configuration())
+ .ipV6Configuration(nic.getIpV6Configuration())
+ .mac(nic.getMac())
+ .model(nic.getModel())
+ .runtime(nic.getRuntime())
+ .vlan(nic.getVlan());
+ }
+ }
+
+ @Named("boot_order")
+ private final int bootOrder;
+ @Named("firewall_policy")
+ private final FirewallPolicy firewallPolicy;
+ @Named("ip_v4_conf")
+ private final IPConfiguration ipV4Configuration;
+ @Named("ip_v6_conf")
+ private final IPConfiguration ipV6Configuration;
+ private final String mac;
+ private final Model model;
+ private final NICStats runtime;
+ private final VLANInfo vlan;
+
+ @ConstructorProperties({
+ "boot_order", "firewall_policy", "ip_v4_conf", "ip_v6_conf",
+ "mac", "model", "runtime", "vlan"
+ })
+ public NIC(int bootOrder, FirewallPolicy firewallPolicy, IPConfiguration ipV4Configuration
+ , IPConfiguration ipV6Configuration, String mac, Model model, NICStats runtime, VLANInfo vlan) {
+ this.bootOrder = bootOrder;
+ this.firewallPolicy = firewallPolicy;
+ this.ipV4Configuration = ipV4Configuration;
+ this.ipV6Configuration = ipV6Configuration;
+ this.mac = mac;
+ this.model = model;
+ this.runtime = runtime;
+ this.vlan = vlan;
+ }
+
+ /**
+ * @return Model of NIC.
+ */
+ public Model getModel() {
+ return model;
+ }
+
+ /**
+ * @return UUID of the private VLAN.
+ */
+ public VLANInfo getVlan() {
+ return vlan;
+ }
+
+ /**
+ * @return MAC address of the server NIC.
+ */
+ public String getMac() {
+ return mac;
+ }
+
+ /**
+ * @return Device boot order.
+ */
+ public int getBootOrder() {
+ return bootOrder;
+ }
+
+ /**
+ * @return Public IPv4 configuration.
+ */
+ public IPConfiguration getIpV4Configuration() {
+ return ipV4Configuration;
+ }
+
+ /**
+ * @return Public IPv6 configuration.
+ */
+ public IPConfiguration getIpV6Configuration() {
+ return ipV6Configuration;
+ }
+
+ /**
+ * @return Firewall policy
+ */
+ public FirewallPolicy getFirewallPolicy() {
+ return firewallPolicy;
+ }
+
+ /**
+ * @return NIC runtime information
+ */
+ public NICStats getRuntime() {
+ return runtime;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (!(o instanceof NIC)) return false;
+
+ NIC nic = (NIC) o;
+
+ if (bootOrder != nic.bootOrder) return false;
+ if (firewallPolicy != null ? !firewallPolicy.equals(nic.firewallPolicy) : nic.firewallPolicy != null)
+ return false;
+ if (ipV4Configuration != null ? !ipV4Configuration.equals(nic.ipV4Configuration) : nic.ipV4Configuration != null)
+ return false;
+ if (ipV6Configuration != null ? !ipV6Configuration.equals(nic.ipV6Configuration) : nic.ipV6Configuration != null)
+ return false;
+ if (mac != null ? !mac.equals(nic.mac) : nic.mac != null) return false;
+ if (model != nic.model) return false;
+ if (runtime != null ? !runtime.equals(nic.runtime) : nic.runtime != null) return false;
+ if (vlan != null ? !vlan.equals(nic.vlan) : nic.vlan != null) return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = bootOrder;
+ result = 31 * result + (firewallPolicy != null ? firewallPolicy.hashCode() : 0);
+ result = 31 * result + (ipV4Configuration != null ? ipV4Configuration.hashCode() : 0);
+ result = 31 * result + (ipV6Configuration != null ? ipV6Configuration.hashCode() : 0);
+ result = 31 * result + (mac != null ? mac.hashCode() : 0);
+ result = 31 * result + (model != null ? model.hashCode() : 0);
+ result = 31 * result + (runtime != null ? runtime.hashCode() : 0);
+ result = 31 * result + (vlan != null ? vlan.hashCode() : 0);
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ return "[" +
+ "bootOrder=" + bootOrder +
+ ", firewallPolicy='" + firewallPolicy + '\'' +
+ ", ipV4Configuration=" + ipV4Configuration +
+ ", ipV6Configuration=" + ipV6Configuration +
+ ", mac='" + mac + '\'' +
+ ", model=" + model +
+ ", runtime=" + runtime +
+ ", vlan='" + vlan + '\'' +
+ "]";
+ }
}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/0d70c84a/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/NICStats.java
----------------------------------------------------------------------
diff --git a/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/NICStats.java b/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/NICStats.java
index af7966a..601c3bb 100644
--- a/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/NICStats.java
+++ b/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/NICStats.java
@@ -24,96 +24,96 @@ import java.beans.ConstructorProperties;
*/
public class NICStats {
- @Named("interface_type")
- private final InterfaceType interfaceType;
- @Named("io")
- private final IOStats ioStats;
- @Named("ip_v4")
- private final String ipV4;
- @Named("ip_v6")
- private final String ipV6;
- private final String mac;
+ @Named("interface_type")
+ private final InterfaceType interfaceType;
+ @Named("io")
+ private final IOStats ioStats;
+ @Named("ip_v4")
+ private final String ipV4;
+ @Named("ip_v6")
+ private final String ipV6;
+ private final String mac;
- @ConstructorProperties({
- "interface_type", "io", "ip_v4", "ip_v6", "mac"
- })
- public NICStats(InterfaceType interfaceType, IOStats ioStats, String ipV4, String ipV6, String mac) {
- this.interfaceType = interfaceType;
- this.ioStats = ioStats;
- this.ipV4 = ipV4;
- this.ipV6 = ipV6;
- this.mac = mac;
- }
+ @ConstructorProperties({
+ "interface_type", "io", "ip_v4", "ip_v6", "mac"
+ })
+ public NICStats(InterfaceType interfaceType, IOStats ioStats, String ipV4, String ipV6, String mac) {
+ this.interfaceType = interfaceType;
+ this.ioStats = ioStats;
+ this.ipV4 = ipV4;
+ this.ipV6 = ipV6;
+ this.mac = mac;
+ }
- /**
- * @return Type of interface
- */
- public InterfaceType getInterfaceType() {
- return interfaceType;
- }
+ /**
+ * @return Type of interface
+ */
+ public InterfaceType getInterfaceType() {
+ return interfaceType;
+ }
- /**
- * @return NIC runtime Input and Output data"
- */
- public IOStats getIoStats() {
- return ioStats;
- }
+ /**
+ * @return NIC runtime Input and Output data"
+ */
+ public IOStats getIoStats() {
+ return ioStats;
+ }
- /**
- * @return Public IPv4 configuration
- */
- public String getIpV4() {
- return ipV4;
- }
+ /**
+ * @return Public IPv4 configuration
+ */
+ public String getIpV4() {
+ return ipV4;
+ }
- /**
- * @return Public IPv6 configuration
- */
- public String getIpV6() {
- return ipV6;
- }
+ /**
+ * @return Public IPv6 configuration
+ */
+ public String getIpV6() {
+ return ipV6;
+ }
- /**
- * @return MAC address of this NIC
- */
- public String getMac() {
- return mac;
- }
+ /**
+ * @return MAC address of this NIC
+ */
+ public String getMac() {
+ return mac;
+ }
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (!(o instanceof NICStats)) return false;
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (!(o instanceof NICStats)) return false;
- NICStats nicStats = (NICStats) o;
+ NICStats nicStats = (NICStats) o;
- if (interfaceType != nicStats.interfaceType) return false;
- if (ioStats != null ? !ioStats.equals(nicStats.ioStats) : nicStats.ioStats != null) return false;
- if (ipV4 != null ? !ipV4.equals(nicStats.ipV4) : nicStats.ipV4 != null) return false;
- if (ipV6 != null ? !ipV6.equals(nicStats.ipV6) : nicStats.ipV6 != null) return false;
- if (mac != null ? !mac.equals(nicStats.mac) : nicStats.mac != null) return false;
+ if (interfaceType != nicStats.interfaceType) return false;
+ if (ioStats != null ? !ioStats.equals(nicStats.ioStats) : nicStats.ioStats != null) return false;
+ if (ipV4 != null ? !ipV4.equals(nicStats.ipV4) : nicStats.ipV4 != null) return false;
+ if (ipV6 != null ? !ipV6.equals(nicStats.ipV6) : nicStats.ipV6 != null) return false;
+ if (mac != null ? !mac.equals(nicStats.mac) : nicStats.mac != null) return false;
- return true;
- }
+ return true;
+ }
- @Override
- public int hashCode() {
- int result = interfaceType != null ? interfaceType.hashCode() : 0;
- result = 31 * result + (ioStats != null ? ioStats.hashCode() : 0);
- result = 31 * result + (ipV4 != null ? ipV4.hashCode() : 0);
- result = 31 * result + (ipV6 != null ? ipV6.hashCode() : 0);
- result = 31 * result + (mac != null ? mac.hashCode() : 0);
- return result;
- }
+ @Override
+ public int hashCode() {
+ int result = interfaceType != null ? interfaceType.hashCode() : 0;
+ result = 31 * result + (ioStats != null ? ioStats.hashCode() : 0);
+ result = 31 * result + (ipV4 != null ? ipV4.hashCode() : 0);
+ result = 31 * result + (ipV6 != null ? ipV6.hashCode() : 0);
+ result = 31 * result + (mac != null ? mac.hashCode() : 0);
+ return result;
+ }
- @Override
- public String toString() {
- return "[" +
- "interfaceType=" + interfaceType +
- ", ioStats=" + ioStats +
- ", ipV4='" + ipV4 + '\'' +
- ", ipV6='" + ipV6 + '\'' +
- ", mac='" + mac + '\'' +
- "]";
- }
+ @Override
+ public String toString() {
+ return "[" +
+ "interfaceType=" + interfaceType +
+ ", ioStats=" + ioStats +
+ ", ipV4='" + ipV4 + '\'' +
+ ", ipV6='" + ipV6 + '\'' +
+ ", mac='" + mac + '\'' +
+ "]";
+ }
}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/0d70c84a/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/Owner.java
----------------------------------------------------------------------
diff --git a/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/Owner.java b/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/Owner.java
index d98658d..48ad311 100644
--- a/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/Owner.java
+++ b/cloudsigma2/src/main/java/org/jclouds/cloudsigma2/domain/Owner.java
@@ -24,146 +24,145 @@ import java.net.URI;
* @author Vladimir Shevchenko
*/
public class Owner {
- public static class Builder{
- private String uuid;
- private URI resourceUri;
- private String email;
-
- public Builder uuid(String uuid) {
- this.uuid = uuid;
- return this;
- }
-
- public Builder resourceUri(URI resourceUri) {
- this.resourceUri = resourceUri;
- return this;
- }
-
- public Builder email(String email) {
- this.email = email;
- return this;
- }
-
- public Owner build() {
- return new Owner(uuid, resourceUri, email);
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((uuid == null) ? 0 : uuid.hashCode());
- result = prime * result + ((resourceUri == null) ? 0 : resourceUri.hashCode());
- result = prime * result + ((email == null) ? 0 : email.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- Builder other = (Builder) obj;
- if (uuid == null) {
- if (other.uuid != null)
- return false;
- } else if (!uuid.equals(other.uuid))
- return false;
- if (resourceUri == null) {
- if (other.resourceUri != null)
- return false;
- } else if (!resourceUri.equals(other.resourceUri))
- return false;
- if (email == null) {
- if (other.email != null)
- return false;
- } else if (!email.equals(other.email))
- return false;
+ public static class Builder {
+ private String uuid;
+ private URI resourceUri;
+ private String email;
+
+ public Builder uuid(String uuid) {
+ this.uuid = uuid;
+ return this;
+ }
+
+ public Builder resourceUri(URI resourceUri) {
+ this.resourceUri = resourceUri;
+ return this;
+ }
+
+ public Builder email(String email) {
+ this.email = email;
+ return this;
+ }
+
+ public Owner build() {
+ return new Owner(uuid, resourceUri, email);
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((uuid == null) ? 0 : uuid.hashCode());
+ result = prime * result + ((resourceUri == null) ? 0 : resourceUri.hashCode());
+ result = prime * result + ((email == null) ? 0 : email.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
return true;
- }
- }
- private String uuid;
- @Named("resoource_uri")
- private URI resourceUri;
- private String email;
-
- @ConstructorProperties({
- "uuid", "resource_uri", "email"
- })
- public Owner(String uuid, URI resourceUri, String email){
- this.uuid = uuid;
- this.resourceUri = resourceUri;
- this.email = email;
- }
-
- /**
- *
- * @return uuid of the owner.
- */
- public String getUuid() {
- return uuid;
- }
-
- /**
- *
- * @return resource uri of the profile.
- */
- public URI getResourceUri() {
- return resourceUri;
- }
-
- public String getEmail() {
- return email;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((uuid == null) ? 0 : uuid.hashCode());
- result = prime * result + ((resourceUri == null) ? 0 : resourceUri.hashCode());
- result = prime * result + ((email == null) ? 0 : email.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
-
- if (obj == null)
+ if (obj == null)
return false;
-
- if (getClass() != obj.getClass())
+ if (getClass() != obj.getClass())
return false;
-
- Owner other = (Owner) obj;
-
- if (resourceUri == null) {
+ Builder other = (Builder) obj;
+ if (uuid == null) {
+ if (other.uuid != null)
+ return false;
+ } else if (!uuid.equals(other.uuid))
+ return false;
+ if (resourceUri == null) {
if (other.resourceUri != null)
- return false;
- } else if (!resourceUri.equals(other.resourceUri))
+ return false;
+ } else if (!resourceUri.equals(other.resourceUri))
return false;
-
- if (uuid == null) {
- if (other.uuid != null)
- return false;
- } else if (!uuid.equals(other.uuid))
+ if (email == null) {
+ if (other.email != null)
+ return false;
+ } else if (!email.equals(other.email))
return false;
+ return true;
+ }
+ }
+
+ private String uuid;
+ @Named("resoource_uri")
+ private URI resourceUri;
+ private String email;
+
+ @ConstructorProperties({
+ "uuid", "resource_uri", "email"
+ })
+ public Owner(String uuid, URI resourceUri, String email) {
+ this.uuid = uuid;
+ this.resourceUri = resourceUri;
+ this.email = email;
+ }
+
+ /**
+ * @return uuid of the owner.
+ */
+ public String getUuid() {
+ return uuid;
+ }
+
+ /**
+ * @return resource uri of the profile.
+ */
+ public URI getResourceUri() {
+ return resourceUri;
+ }
+
+ public String getEmail() {
+ return email;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((uuid == null) ? 0 : uuid.hashCode());
+ result = prime * result + ((resourceUri == null) ? 0 : resourceUri.hashCode());
+ result = prime * result + ((email == null) ? 0 : email.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+
+ if (obj == null)
+ return false;
+
+ if (getClass() != obj.getClass())
+ return false;
+
+ Owner other = (Owner) obj;
+
+ if (resourceUri == null) {
+ if (other.resourceUri != null)
+ return false;
+ } else if (!resourceUri.equals(other.resourceUri))
+ return false;
- if (email == null) {
- if (other.email != null)
- return false;
- } else if (!email.equals(other.email))
+ if (uuid == null) {
+ if (other.uuid != null)
return false;
- return true;
- }
+ } else if (!uuid.equals(other.uuid))
+ return false;
- @Override
- public String toString() {
- return "[uuid=" + uuid + ", email=" + email + ", resourceUri=" + resourceUri + "]";
- }
+ if (email == null) {
+ if (other.email != null)
+ return false;
+ } else if (!email.equals(other.email))
+ return false;
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return "[uuid=" + uuid + ", email=" + email + ", resourceUri=" + resourceUri + "]";
+ }
}