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 2014/07/16 11:20:49 UTC
[7/9] [JCLOUDS-474] refactor SoftLayer support
http://git-wip-us.apache.org/repos/asf/jclouds/blob/717a545b/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductItem.java
----------------------------------------------------------------------
diff --git a/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductItem.java b/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductItem.java
index 289375d..79c8d5b 100644
--- a/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductItem.java
+++ b/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductItem.java
@@ -16,210 +16,132 @@
*/
package org.jclouds.softlayer.domain;
-import static com.google.common.base.Preconditions.checkNotNull;
-
import java.beans.ConstructorProperties;
-import java.util.Set;
import org.jclouds.javax.annotation.Nullable;
import com.google.common.base.Objects;
-import com.google.common.base.Objects.ToStringHelper;
-import com.google.common.collect.ImmutableSet;
/**
- * The SoftLayer_Product_Item data type contains general information relating to
- * a single SoftLayer product.
- *
- * @see <a href=
-"http://sldn.softlayer.com/reference/datatypes/SoftLayer_Product_Item"
-/>
+ * @see <a href= "http://sldn.softlayer.com/reference/datatypes/SoftLayer_Product_Item"
*/
public class ProductItem {
- public static Builder<?> builder() {
- return new ConcreteBuilder();
+ private final int id;
+ private final String description;
+ private final String softwareDescriptionId;
+ private final SoftwareDescription softwareDescription;
+
+ @ConstructorProperties({"id", "description", "softwareDescriptionId", "softwareDescription"})
+ public ProductItem(int id, @Nullable String description, @Nullable String softwareDescriptionId,
+ @Nullable SoftwareDescription softwareDescription) {
+ this.id = id;
+ this.description = description;
+ this.softwareDescriptionId = softwareDescriptionId;
+ this.softwareDescription = softwareDescription;
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public String getSoftwareDescriptionId() {
+ return softwareDescriptionId;
}
- public Builder<?> toBuilder() {
- return new ConcreteBuilder().fromProductItem(this);
+ public SoftwareDescription getSoftwareDescription() {
+ return softwareDescription;
}
- public abstract static class Builder<T extends Builder<T>> {
- protected abstract T self();
- protected int id;
- protected String description;
- protected String units;
- protected Float capacity;
- protected Set<ProductItemPrice> prices = ImmutableSet.of();
- protected Set<ProductItemCategory> categories = ImmutableSet.of();
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ ProductItem that = (ProductItem) o;
+
+ return Objects.equal(this.id, that.id) &&
+ Objects.equal(this.description, that.description) &&
+ Objects.equal(this.softwareDescriptionId, that.softwareDescriptionId) &&
+ Objects.equal(this.softwareDescription, that.softwareDescription);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(id, description, softwareDescriptionId, softwareDescription);
+ }
+
+ @Override
+ public String toString() {
+ return Objects.toStringHelper(this)
+ .add("id", id)
+ .add("description", description)
+ .add("softwareDescriptionId", softwareDescriptionId)
+ .add("softwareDescription", softwareDescription)
+ .toString();
+ }
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ public Builder toBuilder() {
+ return builder().fromProductItem(this);
+ }
+
+ public static class Builder {
+ private int id;
+ private String description;
+ private String softwareDescriptionId;
+ private SoftwareDescription softwareDescription;
/**
* @see ProductItem#getId()
*/
- public T id(int id) {
+ public Builder id(int id) {
this.id = id;
- return self();
+ return this;
}
/**
- * @see ProductItem#getDescription()
+ * @see org.jclouds.softlayer.domain.ProductItem#getDescription() ()
*/
- public T description(String description) {
+ public Builder description(String description) {
this.description = description;
- return self();
- }
-
- /**
- * @see ProductItem#getUnits()
- */
- public T units(String units) {
- this.units = units;
- return self();
+ return this;
}
/**
- * @see ProductItem#getCapacity()
+ * @see org.jclouds.softlayer.domain.ProductItem#getSoftwareDescriptionId() ()
*/
- public T capacity(Float capacity) {
- this.capacity = capacity;
- return self();
+ public Builder softwareDescriptionId(String softwareDescriptionId) {
+ this.softwareDescriptionId = softwareDescriptionId;
+ return this;
}
/**
- * @see ProductItem#getPrices()
+ * @see ProductItem#getSoftwareDescription()
*/
- public T prices(Set<ProductItemPrice> prices) {
- this.prices = ImmutableSet.copyOf(checkNotNull(prices, "prices"));
- return self();
- }
-
- public T prices(ProductItemPrice... in) {
- return prices(ImmutableSet.copyOf(in));
- }
-
- /**
- * @see ProductItem#getCategories()
- */
- public T categories(Set<ProductItemCategory> categories) {
- this.categories = ImmutableSet.copyOf(checkNotNull(categories, "categories"));
- return self();
- }
-
- public T categories(ProductItemCategory... in) {
- return categories(ImmutableSet.copyOf(in));
+ public Builder softwareDescription(SoftwareDescription softwareDescription) {
+ this.softwareDescription = softwareDescription;
+ return this;
}
public ProductItem build() {
- return new ProductItem(id, description, units, capacity, prices, categories);
+ return new ProductItem(id, description, softwareDescriptionId, softwareDescription);
}
- public T fromProductItem(ProductItem in) {
+ public Builder fromProductItem(ProductItem in) {
return this
- .id(in.getId())
- .description(in.getDescription())
- .units(in.getUnits())
- .capacity(in.getCapacity())
- .prices(in.getPrices())
- .categories(in.getCategories());
+ .id(in.getId())
+ .description(in.getDescription())
+ .softwareDescriptionId(in.getSoftwareDescriptionId())
+ .softwareDescription(in.getSoftwareDescription());
}
}
- private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
- @Override
- protected ConcreteBuilder self() {
- return this;
- }
- }
-
- private final int id;
- private final String description;
- private final String units;
- private final Float capacity;
- private final Set<ProductItemPrice> prices;
- private final Set<ProductItemCategory> categories;
-
- @ConstructorProperties({
- "id", "description", "units", "capacity", "prices", "categories"
- })
- protected ProductItem(int id, @Nullable String description, @Nullable String units, @Nullable Float capacity, @Nullable Set<ProductItemPrice> prices, @Nullable Set<ProductItemCategory> categories) {
- this.id = id;
- this.description = description;
- this.units = units;
- this.capacity = capacity;
- this.prices = prices == null ? ImmutableSet.<ProductItemPrice>of() : ImmutableSet.copyOf(prices);
- this.categories = categories == null ? ImmutableSet.<ProductItemCategory>of() : ImmutableSet.copyOf(categories);
- }
-
- /**
- * @return The unique identifier of a specific location.
- */
- public int getId() {
- return this.id;
- }
-
- /**
- * @return A product's description
- */
- @Nullable
- public String getDescription() {
- return this.description;
- }
-
- /**
- * @return The unit of measurement that a product item is measured in.
- */
- @Nullable
- public String getUnits() {
- return this.units;
- }
-
- /**
- * @return Some Product Items have capacity information such as RAM and
- bandwidth, and others. This provides the numerical representation
- of the capacity given in the description of this product item.
- */
- @Nullable
- public Float getCapacity() {
- return this.capacity;
- }
-
- /**
- * @return A product item's prices.
- */
- public Set<ProductItemPrice> getPrices() {
- return this.prices;
- }
-
- /**
- * @return An item's associated item categories.
- */
- public Set<ProductItemCategory> getCategories() {
- return this.categories;
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(id);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) return true;
- if (obj == null || getClass() != obj.getClass()) return false;
- ProductItem that = ProductItem.class.cast(obj);
- return Objects.equal(this.id, that.id);
- }
-
- protected ToStringHelper string() {
- return Objects.toStringHelper(this)
- .add("id", id).add("description", description).add("units", units).add("capacity", capacity).add("prices", prices).add("categories", categories);
- }
-
- @Override
- public String toString() {
- return string().toString();
- }
-
}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/717a545b/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductItemCategory.java
----------------------------------------------------------------------
diff --git a/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductItemCategory.java b/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductItemCategory.java
deleted file mode 100644
index 84ba3f7..0000000
--- a/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductItemCategory.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.softlayer.domain;
-
-import java.beans.ConstructorProperties;
-
-import org.jclouds.javax.annotation.Nullable;
-
-import com.google.common.base.Objects;
-import com.google.common.base.Objects.ToStringHelper;
-
-/**
- * The SoftLayer_Product_Item_Category data type contains
- * general category information for prices.
- *
- * @see <a href=
-"http://sldn.softlayer.com/reference/datatypes/SoftLayer_Product_Item_Category"
-/>
- */
-public class ProductItemCategory {
-
- public static Builder<?> builder() {
- return new ConcreteBuilder();
- }
-
- public Builder<?> toBuilder() {
- return new ConcreteBuilder().fromProductItemCategory(this);
- }
-
- public abstract static class Builder<T extends Builder<T>> {
- protected abstract T self();
-
- protected int id;
- protected String name;
- protected String categoryCode;
-
- /**
- * @see ProductItemCategory#getId()
- */
- public T id(int id) {
- this.id = id;
- return self();
- }
-
- /**
- * @see ProductItemCategory#getName()
- */
- public T name(String name) {
- this.name = name;
- return self();
- }
-
- /**
- * @see ProductItemCategory#getCategoryCode()
- */
- public T categoryCode(String categoryCode) {
- this.categoryCode = categoryCode;
- return self();
- }
-
- public ProductItemCategory build() {
- return new ProductItemCategory(id, name, categoryCode);
- }
-
- public T fromProductItemCategory(ProductItemCategory in) {
- return this
- .id(in.getId())
- .name(in.getName())
- .categoryCode(in.getCategoryCode());
- }
- }
-
- private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
- @Override
- protected ConcreteBuilder self() {
- return this;
- }
- }
-
- private final int id;
- private final String name;
- private final String categoryCode;
-
- @ConstructorProperties({
- "id", "name", "categoryCode"
- })
- protected ProductItemCategory(int id, @Nullable String name, @Nullable String categoryCode) {
- this.id = id;
- this.name = name;
- this.categoryCode = categoryCode;
- }
-
- /**
- * @return The unique identifier of a specific location.
- */
- public int getId() {
- return this.id;
- }
-
- /**
- * @return The friendly, descriptive name of the category as seen on the order forms and on invoices.
- */
- @Nullable
- public String getName() {
- return this.name;
- }
-
- /**
- * @return The code used to identify this category.
- */
- @Nullable
- public String getCategoryCode() {
- return this.categoryCode;
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(id);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) return true;
- if (obj == null || getClass() != obj.getClass()) return false;
- ProductItemCategory that = ProductItemCategory.class.cast(obj);
- return Objects.equal(this.id, that.id);
- }
-
- protected ToStringHelper string() {
- return Objects.toStringHelper(this)
- .add("id", id).add("name", name).add("categoryCode", categoryCode);
- }
-
- @Override
- public String toString() {
- return string().toString();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/717a545b/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductItemPrice.java
----------------------------------------------------------------------
diff --git a/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductItemPrice.java b/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductItemPrice.java
index dce6e95..8bfc0ec 100644
--- a/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductItemPrice.java
+++ b/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductItemPrice.java
@@ -17,209 +17,129 @@
package org.jclouds.softlayer.domain;
import static com.google.common.base.Preconditions.checkNotNull;
-
import java.beans.ConstructorProperties;
-import java.util.Set;
-
-import org.jclouds.javax.annotation.Nullable;
import com.google.common.base.Objects;
-import com.google.common.base.Objects.ToStringHelper;
-import com.google.common.collect.ImmutableSet;
/**
- * The SoftLayer_Product_Item_Price data type contains general information
- * relating to a single SoftLayer product item prices. You can find out what
- * packages each prices is in as well as which category under which this prices is
- * sold. All prices are returned in Floating point values measured in US Dollars
- * ($USD).
- *
- * @see <a href=
-"http://sldn.softlayer.com/reference/datatypes/SoftLayer_Product_Item_Price"
-/>
+ * @see <a href= "http://sldn.softlayer.com/reference/datatypes/SoftLayer_Product_Item_Price"
*/
public class ProductItemPrice {
- public static Builder<?> builder() {
- return new ConcreteBuilder();
+ private final int id;
+ private final float hourlyRecurringFee;
+ private final String recurringFee;
+ private final ProductItem item;
+
+ @ConstructorProperties({"id", "hourlyRecurringFee", "recurringFee", "item"})
+ public ProductItemPrice(int id, float hourlyRecurringFee, String recurringFee, ProductItem item) {
+ this.id = id;
+ this.hourlyRecurringFee = hourlyRecurringFee;
+ this.recurringFee = checkNotNull(recurringFee, "recurringFee");
+ this.item = checkNotNull(item, "item");
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ public float getHourlyRecurringFee() {
+ return hourlyRecurringFee;
+ }
+
+ public String getRecurringFee() {
+ return recurringFee;
+ }
+
+ public ProductItem getItem() {
+ return item;
+ }
+
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ ProductItemPrice that = (ProductItemPrice) o;
+
+ return Objects.equal(this.id, that.id) &&
+ Objects.equal(this.hourlyRecurringFee, that.hourlyRecurringFee) &&
+ Objects.equal(this.recurringFee, that.recurringFee) &&
+ Objects.equal(this.item, that.item);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(id, hourlyRecurringFee, recurringFee, item);
+ }
+
+ @Override
+ public String toString() {
+ return Objects.toStringHelper(this)
+ .add("id", id)
+ .add("hourlyRecurringFee", hourlyRecurringFee)
+ .add("recurringFee", recurringFee)
+ .add("item", item)
+ .toString();
}
- public Builder<?> toBuilder() {
- return new ConcreteBuilder().fromProductItemPrice(this);
+ public static Builder builder() {
+ return new Builder();
}
- public abstract static class Builder<T extends Builder<T>> {
- protected abstract T self();
+ public Builder toBuilder() {
+ return builder().fromProductItemPrice(this);
+ }
- protected int id;
- protected long itemId;
- protected Float recurringFee;
- protected Float hourlyRecurringFee;
- protected ProductItem item;
- protected Set<ProductItemCategory> categories = ImmutableSet.of();
+ public static class Builder {
+ private int id;
+ private float hourlyRecurringFee;
+ private String recurringFee;
+ private ProductItem item;
/**
* @see ProductItemPrice#getId()
*/
- public T id(int id) {
+ public Builder id(int id) {
this.id = id;
- return self();
+ return this;
}
/**
- * @see ProductItemPrice#getItemId()
+ * @see ProductItemPrice#getHourlyRecurringFee()
*/
- public T itemId(long itemId) {
- this.itemId = itemId;
- return self();
+ public Builder hourlyRecurringFee(float hourlyRecurringFee) {
+ this.hourlyRecurringFee = hourlyRecurringFee;
+ return this;
}
/**
* @see ProductItemPrice#getRecurringFee()
*/
- public T recurringFee(Float recurringFee) {
+ public Builder recurringFee(String recurringFee) {
this.recurringFee = recurringFee;
- return self();
- }
-
- /**
- * @see ProductItemPrice#getHourlyRecurringFee()
- */
- public T hourlyRecurringFee(Float hourlyRecurringFee) {
- this.hourlyRecurringFee = hourlyRecurringFee;
- return self();
+ return this;
}
/**
- * @see ProductItemPrice#getItem()
+ * @see org.jclouds.softlayer.domain.ProductItemPrice#getItem()
*/
- public T item(ProductItem item) {
+ public Builder item(ProductItem item) {
this.item = item;
- return self();
- }
-
- /**
- * @see ProductItemPrice#getCategories()
- */
- public T categories(Set<ProductItemCategory> categories) {
- this.categories = ImmutableSet.copyOf(checkNotNull(categories, "categories"));
- return self();
- }
-
- public T categories(ProductItemCategory... in) {
- return categories(ImmutableSet.copyOf(in));
+ return this;
}
public ProductItemPrice build() {
- return new ProductItemPrice(id, itemId, recurringFee, hourlyRecurringFee, item, categories);
+ return new ProductItemPrice(id, hourlyRecurringFee, recurringFee, item);
}
- public T fromProductItemPrice(ProductItemPrice in) {
+ public Builder fromProductItemPrice(ProductItemPrice in) {
return this
- .id(in.getId())
- .itemId(in.getItemId())
- .recurringFee(in.getRecurringFee())
- .hourlyRecurringFee(in.getHourlyRecurringFee())
- .item(in.getItem())
- .categories(in.getCategories());
+ .id(in.getId())
+ .hourlyRecurringFee(in.getHourlyRecurringFee())
+ .recurringFee(in.getRecurringFee())
+ .item(in.getItem());
}
}
-
- private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
- @Override
- protected ConcreteBuilder self() {
- return this;
- }
- }
-
- private final int id;
- private final long itemId;
- private final Float recurringFee;
- private final Float hourlyRecurringFee;
- private final ProductItem item;
- private final Set<ProductItemCategory> categories;
-
- @ConstructorProperties({
- "id", "itemId", "recurringFee", "hourlyRecurringFee", "item", "categories"
- })
- protected ProductItemPrice(int id, long itemId, @Nullable Float recurringFee, @Nullable Float hourlyRecurringFee, @Nullable ProductItem item, @Nullable Set<ProductItemCategory> categories) {
- this.id = id;
- this.itemId = itemId;
- this.recurringFee = recurringFee;
- this.hourlyRecurringFee = hourlyRecurringFee;
- this.item = item;
- this.categories = categories == null ? ImmutableSet.<ProductItemCategory>of() : ImmutableSet.copyOf(categories);
- }
-
- /**
- * @return The unique identifier of a Product Item Price.
- */
- public int getId() {
- return this.id;
- }
-
- /**
- * @return The unique identifier for a product Item
- */
- public long getItemId() {
- return this.itemId;
- }
-
- /**
- * @return A recurring fee is a fee that happens every billing period. This
- fee is represented as a Floating point decimal in US dollars
- ($USD).
- */
- @Nullable
- public Float getRecurringFee() {
- return this.recurringFee;
- }
-
- /**
- * @return The hourly prices for this item, should this item be part of an
- hourly pricing package.
- */
- @Nullable
- public Float getHourlyRecurringFee() {
- return this.hourlyRecurringFee;
- }
-
- /**
- * @return The product item a prices is tied to.
- */
- @Nullable
- public ProductItem getItem() {
- return this.item;
- }
-
- /**
- * @return An item's associated item categories.
- */
- public Set<ProductItemCategory> getCategories() {
- return this.categories;
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(id);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) return true;
- if (obj == null || getClass() != obj.getClass()) return false;
- ProductItemPrice that = ProductItemPrice.class.cast(obj);
- return Objects.equal(this.id, that.id);
- }
-
- protected ToStringHelper string() {
- return Objects.toStringHelper(this)
- .add("id", id).add("itemId", itemId).add("recurringFee", recurringFee).add("hourlyRecurringFee", hourlyRecurringFee).add("item", item).add("categories", categories);
- }
-
- @Override
- public String toString() {
- return string().toString();
- }
-
}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/717a545b/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductOrder.java
----------------------------------------------------------------------
diff --git a/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductOrder.java b/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductOrder.java
deleted file mode 100644
index 51bebcd..0000000
--- a/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductOrder.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.softlayer.domain;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.beans.ConstructorProperties;
-import java.util.Set;
-
-import org.jclouds.javax.annotation.Nullable;
-
-import com.google.common.base.Objects;
-import com.google.common.base.Objects.ToStringHelper;
-import com.google.common.collect.ImmutableSet;
-
-/**
- * Class ProductOrder
- *
- * @see <a href= "http://sldn.softlayer.com/reference/datatypes/SoftLayer_Container_Product_Order_Virtual_Guest"
-/>
- */
-public class ProductOrder {
-
- public static Builder<?> builder() {
- return new ConcreteBuilder();
- }
-
- public Builder<?> toBuilder() {
- return new ConcreteBuilder().fromProductOrder(this);
- }
-
- public abstract static class Builder<T extends Builder<T>> {
- protected abstract T self();
-
- protected int packageId;
- protected String location;
- protected Set<ProductItemPrice> prices = ImmutableSet.of();
- protected Set<VirtualGuest> virtualGuests = ImmutableSet.of();
- protected int quantity;
- protected boolean useHourlyPricing;
-
- /**
- * @see ProductOrder#getPackageId()
- */
- public T packageId(int packageId) {
- this.packageId = packageId;
- return self();
- }
-
- /**
- * @see ProductOrder#getLocation()
- */
- public T location(String location) {
- this.location = location;
- return self();
- }
-
- /**
- * @see ProductOrder#getPrices()
- */
- public T prices(Iterable<ProductItemPrice> prices) {
- this.prices = ImmutableSet.copyOf(checkNotNull(prices, "prices"));
- return self();
- }
-
- public T prices(ProductItemPrice... in) {
- return prices(ImmutableSet.copyOf(in));
- }
-
- /**
- * @see ProductOrder#getVirtualGuests()
- */
- public T virtualGuests(Set<VirtualGuest> virtualGuests) {
- this.virtualGuests = ImmutableSet.copyOf(checkNotNull(virtualGuests, "virtualGuests"));
- return self();
- }
-
- public T virtualGuests(VirtualGuest... in) {
- return virtualGuests(ImmutableSet.copyOf(in));
- }
-
- /**
- * @see ProductOrder#getQuantity()
- */
- public T quantity(int quantity) {
- this.quantity = quantity;
- return self();
- }
-
- /**
- * @see ProductOrder#getUseHourlyPricing()
- */
- public T useHourlyPricing(boolean useHourlyPricing) {
- this.useHourlyPricing = useHourlyPricing;
- return self();
- }
-
- public ProductOrder build() {
- return new ProductOrder(packageId, location, prices, virtualGuests, quantity, useHourlyPricing);
- }
-
- public T fromProductOrder(ProductOrder in) {
- return this
- .packageId(in.getPackageId())
- .location(in.getLocation())
- .prices(in.getPrices())
- .virtualGuests(in.getVirtualGuests())
- .quantity(in.getQuantity())
- .useHourlyPricing(in.getUseHourlyPricing());
- }
- }
-
- private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
- @Override
- protected ConcreteBuilder self() {
- return this;
- }
- }
-
- private final int packageId;
- private final String location;
- private final Set<ProductItemPrice> prices;
- private final Set<VirtualGuest> virtualGuests;
- private final int quantity;
- private final boolean useHourlyPricing;
-
- @ConstructorProperties({
- "packageId", "location", "prices", "virtualGuest", "quantity", "useHourlyPricing"
- })
- protected ProductOrder(int packageId, @Nullable String location, @Nullable Set<ProductItemPrice> prices, @Nullable Set<VirtualGuest> virtualGuests, int quantity, boolean useHourlyPricing) {
- this.packageId = packageId;
- this.location = location;
- this.prices = prices == null ? ImmutableSet.<ProductItemPrice>of() : ImmutableSet.copyOf(prices);
- this.virtualGuests = virtualGuests == null ? ImmutableSet.<VirtualGuest>of() : ImmutableSet.copyOf(virtualGuests);
- this.quantity = quantity;
- this.useHourlyPricing = useHourlyPricing;
- }
-
- /**
- * @return The package id of an order. This is required.
- */
- public int getPackageId() {
- return this.packageId;
- }
-
- /**
- * @return The region keyname or specific location keyname where the order should be provisioned.
- */
- @Nullable
- public String getLocation() {
- return this.location;
- }
-
- /**
- * Gets the item prices in this order.
- * All that is required to be present is the prices ID
- *
- * @return the prices.
- */
- public Set<ProductItemPrice> getPrices() {
- return this.prices;
- }
-
- /**
- * Gets the virtual guests in this order.
- *
- * @return the the virtual guests.
- */
- public Set<VirtualGuest> getVirtualGuests() {
- return this.virtualGuests;
- }
-
- public int getQuantity() {
- return this.quantity;
- }
-
- public boolean getUseHourlyPricing() {
- return this.useHourlyPricing;
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(packageId, location, prices, virtualGuests, quantity, useHourlyPricing);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) return true;
- if (obj == null || getClass() != obj.getClass()) return false;
- ProductOrder that = ProductOrder.class.cast(obj);
- return Objects.equal(this.packageId, that.packageId)
- && Objects.equal(this.location, that.location)
- && Objects.equal(this.prices, that.prices)
- && Objects.equal(this.virtualGuests, that.virtualGuests)
- && Objects.equal(this.quantity, that.quantity)
- && Objects.equal(this.useHourlyPricing, that.useHourlyPricing);
- }
-
- protected ToStringHelper string() {
- return Objects.toStringHelper(this)
- .add("packageId", packageId).add("location", location).add("prices", prices).add("virtualGuests", virtualGuests).add("quantity", quantity).add("useHourlyPricing", useHourlyPricing);
- }
-
- @Override
- public String toString() {
- return string().toString();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/717a545b/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductOrderReceipt.java
----------------------------------------------------------------------
diff --git a/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductOrderReceipt.java b/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductOrderReceipt.java
deleted file mode 100644
index 7948afc..0000000
--- a/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductOrderReceipt.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.softlayer.domain;
-
-import java.beans.ConstructorProperties;
-
-import org.jclouds.javax.annotation.Nullable;
-
-import com.google.common.base.Objects;
-import com.google.common.base.Objects.ToStringHelper;
-
-/**
- * Class ProductOrderReceipt
- *
- * @see <a href= "http://sldn.softlayer.com/reference/datatypes/SoftLayer_Container_Product_Order_Receipt"
-/>
- */
-public class ProductOrderReceipt {
-
- public static Builder<?> builder() {
- return new ConcreteBuilder();
- }
-
- public Builder<?> toBuilder() {
- return new ConcreteBuilder().fromProductOrderReceipt(this);
- }
-
- public abstract static class Builder<T extends Builder<T>> {
- protected abstract T self();
-
- protected int orderId;
- protected ProductOrder orderDetails;
-
- /**
- * @see ProductOrderReceipt#getOrderId()
- */
- public T orderId(int orderId) {
- this.orderId = orderId;
- return self();
- }
-
- /**
- * @see ProductOrderReceipt#getOrderDetails()
- */
- public T orderDetails(ProductOrder orderDetails) {
- this.orderDetails = orderDetails;
- return self();
- }
-
- public ProductOrderReceipt build() {
- return new ProductOrderReceipt(orderId, orderDetails);
- }
-
- public T fromProductOrderReceipt(ProductOrderReceipt in) {
- return this
- .orderId(in.getOrderId())
- .orderDetails(in.getOrderDetails());
- }
- }
-
- private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
- @Override
- protected ConcreteBuilder self() {
- return this;
- }
- }
-
- private final int orderId;
- private final ProductOrder orderDetails;
-
- @ConstructorProperties({
- "orderId", "orderDetails"
- })
- protected ProductOrderReceipt(int orderId, @Nullable ProductOrder orderDetails) {
- this.orderId = orderId;
- this.orderDetails = orderDetails;
- }
-
- /**
- * @return unique identifier for the order.
- */
- public int getOrderId() {
- return this.orderId;
- }
-
- /**
- * This is a copy of the SoftLayer_Container_Product_Order
- * which holds all the data related to an order.
- * This will only return when an order is processed successfully.
- * It will contain all the items in an order as well as the order totals.
- */
- @Nullable
- public ProductOrder getOrderDetails() {
- return this.orderDetails;
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(orderId, orderDetails);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) return true;
- if (obj == null || getClass() != obj.getClass()) return false;
- ProductOrderReceipt that = ProductOrderReceipt.class.cast(obj);
- return Objects.equal(this.orderId, that.orderId)
- && Objects.equal(this.orderDetails, that.orderDetails);
- }
-
- protected ToStringHelper string() {
- return Objects.toStringHelper(this)
- .add("orderId", orderId).add("orderDetails", orderDetails);
- }
-
- @Override
- public String toString() {
- return string().toString();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/717a545b/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductPackage.java
----------------------------------------------------------------------
diff --git a/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductPackage.java b/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductPackage.java
deleted file mode 100644
index c30f5f5..0000000
--- a/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductPackage.java
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.softlayer.domain;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.beans.ConstructorProperties;
-import java.util.Set;
-
-import org.jclouds.javax.annotation.Nullable;
-
-import com.google.common.base.Objects;
-import com.google.common.base.Objects.ToStringHelper;
-import com.google.common.collect.ImmutableSet;
-
-/**
- * The SoftLayer_Product_Package data type contains information about packages
- * from which orders can be generated. Packages contain general information
- * regarding what is in them, where they are currently sold, availability, and
- * pricing.
- *
- * @see <a href=
-"http://sldn.softlayer.com/reference/datatypes/SoftLayer_Product_Package"
-/>
- */
-public class ProductPackage {
-
- public static Builder<?> builder() {
- return new ConcreteBuilder();
- }
-
- public Builder<?> toBuilder() {
- return new ConcreteBuilder().fromProductPackage(this);
- }
-
- public abstract static class Builder<T extends Builder<T>> {
- protected abstract T self();
-
- protected int id;
- protected String name;
- protected String description;
- protected Set<ProductItem> items = ImmutableSet.of();
- protected Set<Datacenter> locations = ImmutableSet.of();
-
- /**
- * @see ProductPackage#getId()
- */
- public T id(int id) {
- this.id = id;
- return self();
- }
-
- /**
- * @see ProductPackage#getName()
- */
- public T name(String name) {
- this.name = name;
- return self();
- }
-
- /**
- * @see ProductPackage#getDescription()
- */
- public T description(String description) {
- this.description = description;
- return self();
- }
-
- /**
- * @see ProductPackage#getItems()
- */
- public T items(Set<ProductItem> items) {
- this.items = ImmutableSet.copyOf(checkNotNull(items, "items"));
- return self();
- }
-
- public T items(ProductItem... in) {
- return items(ImmutableSet.copyOf(in));
- }
-
- /**
- * @see ProductPackage#getDatacenters()
- */
- public T datacenters(Set<Datacenter> locations) {
- this.locations = ImmutableSet.copyOf(checkNotNull(locations, "locations"));
- return self();
- }
-
- public T datacenters(Datacenter... in) {
- return datacenters(ImmutableSet.copyOf(in));
- }
-
- public ProductPackage build() {
- return new ProductPackage(id, name, description, items, locations);
- }
-
- public T fromProductPackage(ProductPackage in) {
- return this
- .id(in.getId())
- .name(in.getName())
- .description(in.getDescription())
- .items(in.getItems())
- .datacenters(in.getDatacenters());
- }
- }
-
- private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
- @Override
- protected ConcreteBuilder self() {
- return this;
- }
- }
-
- private final int id;
- private final String name;
- private final String description;
- private final Set<ProductItem> items;
- private final Set<Datacenter> locations;
-
- @ConstructorProperties({
- "id", "name", "description", "items", "locations"
- })
- protected ProductPackage(int id, @Nullable String name, @Nullable String description, @Nullable Set<ProductItem> items, Set<Datacenter> locations) {
- this.id = id;
- this.name = name;
- this.description = description;
- this.items = items == null ? ImmutableSet.<ProductItem>of() : ImmutableSet.copyOf(items);
- this.locations = locations == null ? ImmutableSet.<Datacenter>of() : ImmutableSet.copyOf(locations);
- }
-
- /**
- * @return A package's internal identifier. Everything regarding a
- SoftLayer_Product_Package is tied back to this id.
- */
- public int getId() {
- return this.id;
- }
-
- /**
- * @return The description of the package. For server packages, this is
- usually a detailed description of processor type and count.
- */
- @Nullable
- public String getName() {
- return this.name;
- }
-
- /**
- * @return A generic description of the processor type and count. This
- includes HTML, so you may want to strip these tags if you plan to
- use it.
- */
- @Nullable
- public String getDescription() {
- return this.description;
- }
-
- /**
- * @return A collection of valid items available for purchase in this
- package.
- */
- public Set<ProductItem> getItems() {
- return this.items;
- }
-
- public Set<Datacenter> getDatacenters() {
- return this.locations;
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(id);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) return true;
- if (obj == null || getClass() != obj.getClass()) return false;
- ProductPackage that = ProductPackage.class.cast(obj);
- return Objects.equal(this.id, that.id);
- }
-
- protected ToStringHelper string() {
- return Objects.toStringHelper(this)
- .add("id", id).add("name", name).add("description", description).add("items", items).add("locations", locations);
- }
-
- @Override
- public String toString() {
- return string().toString();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/717a545b/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/Region.java
----------------------------------------------------------------------
diff --git a/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/Region.java b/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/Region.java
index 89926c2..fa91e82 100644
--- a/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/Region.java
+++ b/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/Region.java
@@ -18,7 +18,6 @@ package org.jclouds.softlayer.domain;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Strings.emptyToNull;
-
import java.beans.ConstructorProperties;
import org.jclouds.javax.annotation.Nullable;
@@ -115,8 +114,10 @@ public class Region implements Comparable<Region> {
@Override
public String toString() {
- return "[keyname=" + keyname + ", description=" + description + "]";
+ return Objects.toStringHelper(this)
+ .add("sortOrder", sortOrder)
+ .add("keyname", keyname)
+ .add("description", description)
+ .toString();
}
-
-
}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/717a545b/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/SoftwareDescription.java
----------------------------------------------------------------------
diff --git a/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/SoftwareDescription.java b/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/SoftwareDescription.java
new file mode 100644
index 0000000..28827fc
--- /dev/null
+++ b/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/SoftwareDescription.java
@@ -0,0 +1,301 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jclouds.softlayer.domain;
+
+import java.beans.ConstructorProperties;
+
+import org.jclouds.javax.annotation.Nullable;
+
+import com.google.common.base.Objects;
+
+public class SoftwareDescription {
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ public Builder toBuilder() {
+ return builder().fromSoftwareDescription(this);
+ }
+
+ public static class Builder {
+
+ protected int id;
+ protected String longDescription;
+ protected String manufacturer;
+ protected String name;
+ protected int operatingSystem;
+ protected String referenceCode;
+ protected String requiredUser;
+ protected String version;
+ protected int controlPanel;
+ protected String upgradeSoftwareDescriptionId;
+ protected String upgradeSwDescId;
+ protected String virtualLicense;
+ protected String virtualizationPlatform;
+
+ /**
+ * @see SoftwareDescription#getId()
+ */
+ public Builder id(int id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * @see SoftwareDescription#getLongDescription()
+ */
+ public Builder longDescription(String longDescription) {
+ this.longDescription = longDescription;
+ return this;
+ }
+
+ /**
+ * @see SoftwareDescription#getManufacturer()
+ */
+ public Builder manufacturer(String manufacturer) {
+ this.manufacturer = manufacturer;
+ return this;
+ }
+
+ /**
+ * @see SoftwareDescription#getName()
+ */
+ public Builder name(String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * @see SoftwareDescription#getOperatingSystem()
+ */
+ public Builder operatingSystem(int operatingSystem) {
+ this.operatingSystem = operatingSystem;
+ return this;
+ }
+
+ /**
+ * @see SoftwareDescription#getReferenceCode()
+ */
+ public Builder referenceCode(String referenceCode) {
+ this.referenceCode = referenceCode;
+ return this;
+ }
+
+ /**
+ * @see SoftwareDescription#getRequiredUser()
+ */
+ public Builder requiredUser(String requiredUser) {
+ this.requiredUser = requiredUser;
+ return this;
+ }
+
+ /**
+ * @see SoftwareDescription#getVersion()
+ */
+ public Builder version(String version) {
+ this.version = version;
+ return this;
+ }
+
+ public Builder controlPanel(int controlPanel) {
+ this.controlPanel = controlPanel;
+ return this;
+ }
+
+ public Builder upgradeSoftwareDescriptionId(String upgradeSoftwareDescriptionId) {
+ this.upgradeSoftwareDescriptionId = upgradeSoftwareDescriptionId;
+ return this;
+ }
+
+ public Builder upgradeSwDescId(String upgradeSwDescId) {
+ this.upgradeSwDescId = upgradeSwDescId;
+ return this;
+ }
+
+ public Builder virtualLicense(String virtualLicense) {
+ this.virtualLicense = virtualLicense;
+ return this;
+ }
+
+ public Builder virtualizationPlatform(String virtualizationPlatform) {
+ this.virtualizationPlatform = virtualizationPlatform;
+ return this;
+ }
+
+ public SoftwareDescription build() {
+ return new SoftwareDescription(id, longDescription, manufacturer, name, operatingSystem, referenceCode,
+ requiredUser, version, controlPanel, upgradeSoftwareDescriptionId, upgradeSwDescId, virtualLicense,
+ virtualizationPlatform);
+ }
+
+ public Builder fromSoftwareDescription(SoftwareDescription in) {
+ return this
+ .id(in.getId())
+ .longDescription(in.getLongDescription())
+ .manufacturer(in.getManufacturer())
+ .name(in.getName())
+ .operatingSystem(in.getOperatingSystem())
+ .referenceCode(in.getReferenceCode())
+ .requiredUser(in.getRequiredUser())
+ .version(in.getVersion())
+ .controlPanel(in.getControlPanel())
+ .upgradeSoftwareDescriptionId(in.getUpgradeSoftwareDescriptionId())
+ .upgradeSwDescId(in.getUpgradeSwDescId())
+ .virtualLicense(in.getVirtualLicense())
+ .virtualizationPlatform(in.getVirtualizationPlatform());
+ }
+ }
+
+ private final int id;
+ private final String longDescription;
+ private final String manufacturer;
+ private final String name;
+ private final int operatingSystem;
+ private final String referenceCode;
+ private final String requiredUser;
+ private final String version;
+ private final int controlPanel;
+ private final String upgradeSoftwareDescriptionId;
+ private final String upgradeSwDescId;
+ private final String virtualLicense;
+ private final String virtualizationPlatform;
+
+ @ConstructorProperties({
+ "id", "longDescription", "manufacturer", "name", "operatingSystem", "referenceCode", "requiredUser",
+ "version", "controlPanel", "upgradeSoftwareDescriptionId", "upgradeSwDescId", "virtualLicense",
+ "virtualizationPlatform"
+ })
+ protected SoftwareDescription(int id, @Nullable String longDescription, @Nullable String manufacturer,
+ @Nullable String name, int operatingSystem, @Nullable String referenceCode,
+ @Nullable String requiredUser, @Nullable String version, int controlPanel,
+ @Nullable String upgradeSoftwareDescriptionId, @Nullable String upgradeSwDescId,
+ @Nullable String virtualLicense, @Nullable String virtualizationPlatform) {
+ this.id = id;
+ this.longDescription = longDescription;
+ this.manufacturer = manufacturer;
+ this.name = name;
+ this.operatingSystem = operatingSystem;
+ this.referenceCode = referenceCode;
+ this.requiredUser = requiredUser;
+ this.version = version;
+ this.controlPanel = controlPanel;
+ this.upgradeSoftwareDescriptionId = upgradeSoftwareDescriptionId;
+ this.upgradeSwDescId = upgradeSwDescId;
+ this.virtualLicense = virtualLicense;
+ this.virtualizationPlatform = virtualizationPlatform;
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ public String getLongDescription() {
+ return longDescription;
+ }
+
+ public String getManufacturer() {
+ return manufacturer;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public int getOperatingSystem() {
+ return operatingSystem;
+ }
+
+ public String getReferenceCode() {
+ return referenceCode;
+ }
+
+ public String getRequiredUser() {
+ return requiredUser;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public int getControlPanel() {
+ return controlPanel;
+ }
+
+ public String getUpgradeSoftwareDescriptionId() {
+ return upgradeSoftwareDescriptionId;
+ }
+
+ public String getUpgradeSwDescId() {
+ return upgradeSwDescId;
+ }
+
+ public String getVirtualLicense() {
+ return virtualLicense;
+ }
+
+ public String getVirtualizationPlatform() {
+ return virtualizationPlatform;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ SoftwareDescription that = (SoftwareDescription) o;
+
+ return Objects.equal(this.id, that.id) &&
+ Objects.equal(this.longDescription, that.longDescription) &&
+ Objects.equal(this.manufacturer, that.manufacturer) &&
+ Objects.equal(this.name, that.name) &&
+ Objects.equal(this.operatingSystem, that.operatingSystem) &&
+ Objects.equal(this.referenceCode, that.referenceCode) &&
+ Objects.equal(this.requiredUser, that.requiredUser) &&
+ Objects.equal(this.version, that.version) &&
+ Objects.equal(this.controlPanel, that.controlPanel) &&
+ Objects.equal(this.upgradeSoftwareDescriptionId, that.upgradeSoftwareDescriptionId) &&
+ Objects.equal(this.upgradeSwDescId, that.upgradeSwDescId) &&
+ Objects.equal(this.virtualLicense, that.virtualLicense) &&
+ Objects.equal(this.virtualizationPlatform, that.virtualizationPlatform);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(id, longDescription, manufacturer, name, operatingSystem, referenceCode,
+ requiredUser, version, controlPanel, upgradeSoftwareDescriptionId, upgradeSwDescId,
+ virtualLicense, virtualizationPlatform);
+ }
+
+ @Override
+ public String toString() {
+ return Objects.toStringHelper(this)
+ .add("id", id)
+ .add("longDescription", longDescription)
+ .add("manufacturer", manufacturer)
+ .add("name", name)
+ .add("operatingSystem", operatingSystem)
+ .add("referenceCode", referenceCode)
+ .add("requiredUser", requiredUser)
+ .add("version", version)
+ .add("controlPanel", controlPanel)
+ .add("upgradeSoftwareDescriptionId", upgradeSoftwareDescriptionId)
+ .add("upgradeSwDescId", upgradeSwDescId)
+ .add("virtualLicense", virtualLicense)
+ .add("virtualizationPlatform", virtualizationPlatform)
+ .toString();
+ }
+}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/717a545b/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/SoftwareLicense.java
----------------------------------------------------------------------
diff --git a/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/SoftwareLicense.java b/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/SoftwareLicense.java
new file mode 100644
index 0000000..78f8431
--- /dev/null
+++ b/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/SoftwareLicense.java
@@ -0,0 +1,130 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jclouds.softlayer.domain;
+
+import com.google.common.base.Objects;
+import org.jclouds.javax.annotation.Nullable;
+
+import java.beans.ConstructorProperties;
+
+public class SoftwareLicense {
+
+ private final int id;
+ private final SoftwareDescription softwareDescription;
+ private final int softwareDescriptionId;
+
+ @ConstructorProperties({
+ "id", "softwareDescription", "softwareDescriptionId"
+ })
+ protected SoftwareLicense(int id, @Nullable SoftwareDescription softwareDescription, int softwareDescriptionId) {
+ this.id = id;
+ this.softwareDescription = softwareDescription;
+ this.softwareDescriptionId = softwareDescriptionId;
+ }
+
+ public int getId() {
+ return this.id;
+ }
+
+ @Nullable
+ public SoftwareDescription getSoftwareDescription() {
+ return this.softwareDescription;
+ }
+
+ /**
+ * @return A longer location description.
+ */
+ public int getSoftwareDescriptionId() {
+ return this.softwareDescriptionId;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ SoftwareLicense that = (SoftwareLicense) o;
+
+ return Objects.equal(this.id, that.id) &&
+ Objects.equal(this.softwareDescription, that.softwareDescription) &&
+ Objects.equal(this.softwareDescriptionId, that.softwareDescriptionId);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(id, softwareDescription, softwareDescriptionId);
+ }
+
+ @Override
+ public String toString() {
+ return Objects.toStringHelper(this)
+ .add("id", id)
+ .add("softwareDescription", softwareDescription)
+ .add("softwareDescriptionId", softwareDescriptionId)
+ .toString();
+ }
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ public Builder toBuilder() {
+ return builder().fromSoftwareLicense(this);
+ }
+
+ public static class Builder {
+ protected int id;
+ protected SoftwareDescription softwareDescription;
+ protected int softwareDescriptionId;
+
+ /**
+ * @see SoftwareLicense#getId()
+ */
+ public Builder id(int id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * @see org.jclouds.softlayer.domain.SoftwareLicense#getSoftwareDescription() ()
+ */
+ public Builder softwareDescription(SoftwareDescription softwareDescription) {
+ this.softwareDescription = softwareDescription;
+ return this;
+ }
+
+ /**
+ * @see org.jclouds.softlayer.domain.SoftwareLicense#getSoftwareDescriptionId() ()
+ */
+ public Builder softwareDescriptionId(int softwareDescriptionId) {
+ this.softwareDescriptionId = softwareDescriptionId;
+ return this;
+ }
+
+ public SoftwareLicense build() {
+ return new SoftwareLicense(id, softwareDescription, softwareDescriptionId);
+ }
+
+ public Builder fromSoftwareLicense(SoftwareLicense in) {
+ return this
+ .id(in.getId())
+ .softwareDescription(in.getSoftwareDescription())
+ .softwareDescriptionId(in.getSoftwareDescriptionId());
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/717a545b/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/Tag.java
----------------------------------------------------------------------
diff --git a/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/Tag.java b/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/Tag.java
new file mode 100644
index 0000000..719f110
--- /dev/null
+++ b/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/Tag.java
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jclouds.softlayer.domain;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+import java.beans.ConstructorProperties;
+
+import com.google.common.base.Objects;
+
+public class Tag {
+ private final int accountId;
+ private final int id;
+ private final int internal;
+ private final String name;
+
+ @ConstructorProperties({"accountId", "id", "internal", "name"} )
+ public Tag(int accountId, int id, int internal, String name) {
+ this.accountId = accountId;
+ this.id = id;
+ this.internal = internal;
+ this.name = checkNotNull(name, "name");
+ }
+
+ public int getAccountId() {
+ return accountId;
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ public int getInternal() {
+ return internal;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ Tag that = (Tag) o;
+
+ return Objects.equal(this.accountId, that.accountId) &&
+ Objects.equal(this.id, that.id) &&
+ Objects.equal(this.internal, that.internal) &&
+ Objects.equal(this.name, that.name);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(accountId, id, internal, name);
+ }
+
+ @Override
+ public String toString() {
+ return Objects.toStringHelper(this)
+ .add("accountId", accountId)
+ .add("id", id)
+ .add("internal", internal)
+ .add("name", name)
+ .toString();
+ }
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ public Builder toBuilder() {
+ return builder().fromTag(this);
+ }
+
+ public static class Builder {
+ private int accountId;
+ private int id;
+ private int internal;
+ private String name;
+
+ /**
+ * @see org.jclouds.softlayer.domain.Tag#getAccountId()
+ */
+ public Builder accountId(int accountId) {
+ this.accountId = accountId;
+ return this;
+ }
+
+ /**
+ * @see Tag#getId()
+ */
+ public Builder id(int id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * @see org.jclouds.softlayer.domain.Tag#getInternal()
+ */
+ public Builder internal(int internal) {
+ this.internal = internal;
+ return this;
+ }
+
+ /**
+ * @see Tag#getName()
+ */
+ public Builder name(String name) {
+ this.name = name;
+ return this;
+ }
+
+ public Tag build() {
+ return new Tag(accountId, id, internal, name);
+ }
+
+ public Builder fromTag(Tag in) {
+ return this
+ .accountId(in.getAccountId())
+ .id(in.getId())
+ .internal(in.getInternal())
+ .name(in.getName());
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/717a545b/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/TagReference.java
----------------------------------------------------------------------
diff --git a/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/TagReference.java b/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/TagReference.java
new file mode 100644
index 0000000..924e5bc
--- /dev/null
+++ b/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/TagReference.java
@@ -0,0 +1,218 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jclouds.softlayer.domain;
+
+import java.beans.ConstructorProperties;
+
+import org.jclouds.javax.annotation.Nullable;
+
+import com.google.common.base.Objects;
+
+/**
+ * @see <a href= "http://sldn.softlayer.com/reference/datatypes/SoftLayer_Tag_Reference"/>
+ */
+public class TagReference {
+ private final int id;
+ private final int usrRecordId;
+ private final int tagTypeId;
+ private final int tagId;
+ private final int resourceTableId;
+ private final int empRecordId;
+ private final Tag tag;
+ private final TagType tagType;
+
+ @ConstructorProperties({"id", "usrRecordId", "tagTypeId", "tagId", "resourceTableId", "empRecordId", "tag", "tagType"} )
+ public TagReference(int id, int usrRecordId, int tagTypeId, int tagId, int resourceTableId, int empRecordId,
+ @Nullable Tag tag, @Nullable TagType tagType) {
+ this.id = id;
+ this.usrRecordId = usrRecordId;
+ this.tagTypeId = tagTypeId;
+ this.tagId = tagId;
+ this.resourceTableId = resourceTableId;
+ this.empRecordId = empRecordId;
+ this.tag = tag;
+ this.tagType = tagType;
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ public int getUsrRecordId() {
+ return usrRecordId;
+ }
+
+ public int getTagTypeId() {
+ return tagTypeId;
+ }
+
+ public int getTagId() {
+ return tagId;
+ }
+
+ public int getResourceTableId() {
+ return resourceTableId;
+ }
+
+ public int getEmpRecordId() {
+ return empRecordId;
+ }
+
+ public Tag getTag() {
+ return tag;
+ }
+
+ public TagType getTagType() {
+ return tagType;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ TagReference that = (TagReference) o;
+
+ return Objects.equal(this.id, that.id) &&
+ Objects.equal(this.usrRecordId, that.usrRecordId) &&
+ Objects.equal(this.tagTypeId, that.tagTypeId) &&
+ Objects.equal(this.tagId, that.tagId) &&
+ Objects.equal(this.resourceTableId, that.resourceTableId) &&
+ Objects.equal(this.empRecordId, that.empRecordId) &&
+ Objects.equal(this.tag, that.tag) &&
+ Objects.equal(this.tagType, that.tagType);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(id, usrRecordId, tagTypeId, tagId, resourceTableId, empRecordId,
+ tag, tagType);
+ }
+
+ @Override
+ public String toString() {
+ return Objects.toStringHelper(this)
+ .add("id", id)
+ .add("usrRecordId", usrRecordId)
+ .add("tagTypeId", tagTypeId)
+ .add("tagId", tagId)
+ .add("resourceTableId", resourceTableId)
+ .add("empRecordId", empRecordId)
+ .add("tag", tag)
+ .add("tagType", tagType)
+ .toString();
+ }
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ public Builder toBuilder() {
+ return builder().fromTagReference(this);
+ }
+
+ public static class Builder {
+ private int id;
+ private int usrRecordId;
+ private int tagTypeId;
+ private int tagId;
+ private int resourceTableId;
+ private int empRecordId;
+ private Tag tag;
+ private TagType tagType;
+
+ /**
+ * @see TagReference#getId()
+ */
+ public Builder id(int id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * @see org.jclouds.softlayer.domain.TagReference#getUsrRecordId()
+ */
+ public Builder usrRecordId(int usrRecordId) {
+ this.usrRecordId = usrRecordId;
+ return this;
+ }
+
+ /**
+ * @see org.jclouds.softlayer.domain.TagReference#getTagTypeId()
+ */
+ public Builder tagTypeId(int tagTypeId) {
+ this.tagTypeId = tagTypeId;
+ return this;
+ }
+
+ /**
+ * @see TagReference#getTagId()
+ */
+ public Builder tagId(int tagId) {
+ this.tagId = tagId;
+ return this;
+ }
+
+ /**
+ * @see org.jclouds.softlayer.domain.TagReference#getResourceTableId()
+ */
+ public Builder resourceTableId(int resourceTableId) {
+ this.resourceTableId = resourceTableId;
+ return this;
+ }
+
+ /**
+ * @see TagReference#getEmpRecordId()
+ */
+ public Builder empRecordId(int empRecordId) {
+ this.empRecordId = empRecordId;
+ return this;
+ }
+
+ /**
+ * @see TagReference#getTag()
+ */
+ public Builder tag(Tag tag) {
+ this.tag = tag;
+ return this;
+ }
+
+ /**
+ * @see org.jclouds.softlayer.domain.TagReference#getTagType()
+ */
+ public Builder tagType(TagType tagType) {
+ this.tagType = tagType;
+ return this;
+ }
+
+ public TagReference build() {
+ return new TagReference(id, usrRecordId, tagTypeId, tagId, resourceTableId, empRecordId, tag, tagType);
+ }
+
+ public Builder fromTagReference(TagReference in) {
+ return this
+ .id(in.getId())
+ .usrRecordId(in.getUsrRecordId())
+ .tagTypeId(in.getTagTypeId())
+ .tagId(in.getTagId())
+ .resourceTableId(in.getResourceTableId())
+ .empRecordId(in.getResourceTableId())
+ .tag(in.getTag())
+ .tagType(in.getTagType());
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/717a545b/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/TagType.java
----------------------------------------------------------------------
diff --git a/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/TagType.java b/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/TagType.java
new file mode 100644
index 0000000..8fbe417
--- /dev/null
+++ b/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/TagType.java
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jclouds.softlayer.domain;
+
+import com.google.common.base.Objects;
+import org.jclouds.javax.annotation.Nullable;
+
+import java.beans.ConstructorProperties;
+
+public class TagType {
+ private final String keyName;
+ private final String description;
+
+ @ConstructorProperties({"keyName", "description"} )
+ public TagType(@Nullable String keyName, @Nullable String description) {
+ this.keyName = keyName;
+ this.description = description;
+ }
+
+ public String getKeyName() {
+ return keyName;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ TagType that = (TagType) o;
+
+ return Objects.equal(this.keyName, that.keyName) &&
+ Objects.equal(this.description, that.description);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(keyName, description);
+ }
+
+ @Override
+ public String toString() {
+ return Objects.toStringHelper(this)
+ .add("keyName", keyName)
+ .add("description", description)
+ .toString();
+ }
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ public Builder toBuilder() {
+ return builder().fromTagType(this);
+ }
+
+ public static class Builder {
+ private String keyName;
+ private String description;
+
+ /**
+ * @see org.jclouds.softlayer.domain.TagType#getKeyName()
+ */
+ public Builder keyName(String keyName) {
+ this.keyName = keyName;
+ return this;
+ }
+
+ /**
+ * @see TagType#getDescription()
+ */
+ public Builder description(String description) {
+ this.description = description;
+ return this;
+ }
+
+ public TagType build() {
+ return new TagType(keyName, description);
+ }
+
+ public Builder fromTagType(TagType in) {
+ return this
+ .keyName(in.getKeyName())
+ .description(in.getDescription());
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/717a545b/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/VirtualDiskImage.java
----------------------------------------------------------------------
diff --git a/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/VirtualDiskImage.java b/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/VirtualDiskImage.java
new file mode 100644
index 0000000..8bc6f13
--- /dev/null
+++ b/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/VirtualDiskImage.java
@@ -0,0 +1,249 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOBuilderICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * Builderhe ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WIBuilderHOUBuilder WARRANBuilderIES OR CONDIBuilderIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jclouds.softlayer.domain;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+import java.beans.ConstructorProperties;
+import java.util.Set;
+
+import org.jclouds.javax.annotation.Nullable;
+
+import com.google.common.base.Objects;
+import com.google.common.collect.ImmutableSet;
+
+/**
+ * Class VirtualDiskImage
+ *
+ * @see <a href= "http://sldn.softlayer.com/reference/datatypes/SoftLayer_Virtual_Disk_Image"/>
+ */
+public class VirtualDiskImage {
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ public Builder toBuilder() {
+ return builder().fromVirtualDiskImage(this);
+ }
+
+ public static class Builder {
+
+ protected int id;
+ protected String uuid;
+ protected float capacity;
+ protected String units;
+ protected int typeId;
+ protected String description;
+ protected String name;
+ protected int storageRepositoryId;
+ protected ImmutableSet.Builder<VirtualDiskImageSoftware> softwareReferences = ImmutableSet.builder();
+
+ /**
+ * @see org.jclouds.softlayer.domain.VirtualDiskImage#getId()
+ */
+ public Builder id(int id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * @see org.jclouds.softlayer.domain.VirtualDiskImage#getUuid()
+ */
+ public Builder uuid(String uuid) {
+ this.uuid = uuid;
+ return this;
+ }
+
+ /**
+ * @see org.jclouds.softlayer.domain.VirtualDiskImage#getCapacity()
+ */
+ public Builder capacity(float capacity) {
+ this.capacity = capacity;
+ return this;
+ }
+
+ /**
+ * @see org.jclouds.softlayer.domain.VirtualDiskImage#getUnits()
+ */
+ public Builder units(String units) {
+ this.units = units;
+ return this;
+ }
+
+ /**
+ * @see org.jclouds.softlayer.domain.VirtualDiskImage#getBuilderypeId()
+ */
+ public Builder typeId(int typeId) {
+ this.typeId = typeId;
+ return this;
+ }
+
+ /**
+ * @see org.jclouds.softlayer.domain.VirtualDiskImage#getDescription()
+ */
+ public Builder description(String description) {
+ this.description = description;
+ return this;
+ }
+
+ /**
+ * @see org.jclouds.softlayer.domain.VirtualDiskImage#getName()
+ */
+ public Builder name(String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * @see org.jclouds.softlayer.domain.VirtualDiskImage#getStorageRepositoryId()
+ */
+ public Builder storageRepositoryId(int storageRepositoryId) {
+ this.storageRepositoryId = storageRepositoryId;
+ return this;
+ }
+
+ public Builder softwareReferences(Set<VirtualDiskImageSoftware> softwareReferences) {
+ this.softwareReferences.addAll(checkNotNull(softwareReferences, "softwareReferences"));
+ return this;
+ }
+
+ public Builder softwareReferences(VirtualDiskImageSoftware... in) {
+ return softwareReferences(ImmutableSet.copyOf(in));
+ }
+
+ public VirtualDiskImage build() {
+ return new VirtualDiskImage(id, uuid, capacity, units, typeId, description, name,
+ storageRepositoryId, softwareReferences.build());
+ }
+
+ public Builder fromVirtualDiskImage(VirtualDiskImage in) {
+ return this
+ .id(in.getId())
+ .uuid(in.getUuid())
+ .capacity(in.getCapacity())
+ .units(in.getUnits())
+ .typeId(in.getBuilderypeId())
+ .description(in.getDescription())
+ .name(in.getName())
+ .storageRepositoryId(in.getStorageRepositoryId())
+ .softwareReferences(in.getSoftwareReferences());
+ }
+ }
+
+ private final int id;
+ private final String uuid;
+ private final float capacity;
+ private final String units;
+ private final int typeId;
+ private final String description;
+ private final String name;
+ private final int storageRepositoryId;
+ private final Set<VirtualDiskImageSoftware> softwareReferences;
+
+ @ConstructorProperties({
+ "id", "uuid", "capacity", "units", "typeId", "description", "name", "storageRepositoryId", "softwareReferences"
+ })
+ public VirtualDiskImage(int id, @Nullable String uuid, float capacity, @Nullable String units, int typeId,
+ @Nullable String description, @Nullable String name, int storageRepositoryId,
+ @Nullable Set<VirtualDiskImageSoftware> softwareReferences) {
+ this.id = id;
+ this.uuid = uuid;
+ this.capacity = capacity;
+ this.units = units;
+ this.typeId = typeId;
+ this.description = description;
+ this.name = name;
+ this.storageRepositoryId = storageRepositoryId;
+ this.softwareReferences = softwareReferences == null ? ImmutableSet.<VirtualDiskImageSoftware>of() :
+ ImmutableSet.copyOf(softwareReferences);
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ public String getUuid() {
+ return uuid;
+ }
+
+ public float getCapacity() {
+ return capacity;
+ }
+
+ public String getUnits() {
+ return units;
+ }
+
+ public int getBuilderypeId() {
+ return typeId;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public int getStorageRepositoryId() {
+ return storageRepositoryId;
+ }
+
+ public Set<VirtualDiskImageSoftware> getSoftwareReferences() {
+ return softwareReferences;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ VirtualDiskImage that = (VirtualDiskImage) o;
+
+ return Objects.equal(this.id, that.id) &&
+ Objects.equal(this.uuid, that.uuid) &&
+ Objects.equal(this.capacity, that.capacity) &&
+ Objects.equal(this.units, that.units) &&
+ Objects.equal(this.typeId, that.typeId) &&
+ Objects.equal(this.description, that.description) &&
+ Objects.equal(this.name, that.name) &&
+ Objects.equal(this.storageRepositoryId, that.storageRepositoryId) &&
+ Objects.equal(this.softwareReferences, that.softwareReferences);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(id, uuid, capacity, units, typeId, description,
+ name, storageRepositoryId, softwareReferences);
+ }
+
+ @Override
+ public String toString() {
+ return Objects.toStringHelper(this)
+ .add("id", id)
+ .add("uuid", uuid)
+ .add("capacity", capacity)
+ .add("units", units)
+ .add("typeId", typeId)
+ .add("description", description)
+ .add("name", name)
+ .add("storageRepositoryId", storageRepositoryId)
+ .add("softwareReferences", softwareReferences)
+ .toString();
+ }
+}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/717a545b/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/VirtualDiskImageSoftware.java
----------------------------------------------------------------------
diff --git a/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/VirtualDiskImageSoftware.java b/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/VirtualDiskImageSoftware.java
new file mode 100644
index 0000000..3378d75
--- /dev/null
+++ b/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/VirtualDiskImageSoftware.java
@@ -0,0 +1,126 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jclouds.softlayer.domain;
+
+import java.beans.ConstructorProperties;
+
+import org.jclouds.javax.annotation.Nullable;
+
+import com.google.common.base.Objects;
+
+public class VirtualDiskImageSoftware {
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ public Builder toBuilder() {
+ return builder().fromVirtualDiskImageSoftware(this);
+ }
+
+ public static class Builder {
+
+ protected int id;
+ protected int softwareDescriptionId;
+ protected SoftwareDescription softwareDescription;
+
+ /**
+ * @see VirtualDiskImageSoftware#getId()
+ */
+ public Builder id(int id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * @see VirtualDiskImageSoftware#getSoftwareDescriptionId()
+ */
+ public Builder softwareDescriptionId(int softwareDescriptionId) {
+ this.softwareDescriptionId = softwareDescriptionId;
+ return this;
+ }
+
+ /**
+ * @see org.jclouds.softlayer.domain.VirtualDiskImageSoftware#getSoftwareDescription()
+ */
+ public Builder softwareDescription(SoftwareDescription softwareDescription) {
+ this.softwareDescription = softwareDescription;
+ return this;
+ }
+
+ public VirtualDiskImageSoftware build() {
+ return new VirtualDiskImageSoftware(id, softwareDescriptionId, softwareDescription);
+ }
+
+ public Builder fromVirtualDiskImageSoftware(VirtualDiskImageSoftware in) {
+ return this
+ .id(in.getId())
+ .softwareDescriptionId(in.getSoftwareDescriptionId())
+ .softwareDescription(in.getSoftwareDescription());
+ }
+ }
+
+ private final int id;
+ private final int softwareDescriptionId;
+ private final SoftwareDescription softwareDescription;
+
+ @ConstructorProperties({"id", "softwareDescriptionId", "softwareDescription"})
+ public VirtualDiskImageSoftware(int id, int softwareDescriptionId, @Nullable SoftwareDescription softwareDescription) {
+ this.id = id;
+ this.softwareDescriptionId = softwareDescriptionId;
+ this.softwareDescription = softwareDescription;
+ }
+
+ public int getId() {
+ return this.id;
+ }
+
+ public int getSoftwareDescriptionId() {
+ return this.softwareDescriptionId;
+ }
+
+ @Nullable
+ public SoftwareDescription getSoftwareDescription() {
+ return this.softwareDescription;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(id, softwareDescriptionId, softwareDescription);
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ VirtualDiskImageSoftware that = (VirtualDiskImageSoftware) o;
+
+ return Objects.equal(this.id, that.id) &&
+ Objects.equal(this.softwareDescriptionId, that.softwareDescriptionId) &&
+ Objects.equal(this.softwareDescription, that.softwareDescription);
+ }
+
+ @Override
+ public String toString() {
+ return Objects.toStringHelper(this)
+ .add("id", id)
+ .add("softwareDescriptionId", softwareDescriptionId)
+ .add("softwareDescription", softwareDescription)
+ .toString();
+ }
+}