mirror of https://github.com/apache/jclouds.git
Issue 158: Refactor long id's/properties to int's where the Softlayer API says int (everywhere)
This commit is contained in:
parent
17fddf9177
commit
338c8ba90d
|
@ -33,12 +33,12 @@ public class Address implements Comparable<Address> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder {
|
public static class Builder {
|
||||||
private long id = -1;
|
private int id = -1;
|
||||||
private String country;
|
private String country;
|
||||||
private String state;
|
private String state;
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
public Builder id(long id) {
|
public Builder id(int id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,7 @@ public class Address implements Comparable<Address> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private long id = -1;
|
private int id = -1;
|
||||||
private String country;
|
private String country;
|
||||||
private String state;
|
private String state;
|
||||||
private String description;
|
private String description;
|
||||||
|
@ -80,7 +80,7 @@ public class Address implements Comparable<Address> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Address(long id, String country, String state, String description) {
|
public Address(int id, String country, String state, String description) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.country = checkNotNull(emptyToNull(country),"country cannot be null or empty:"+country);
|
this.country = checkNotNull(emptyToNull(country),"country cannot be null or empty:"+country);
|
||||||
this.state = state;
|
this.state = state;
|
||||||
|
@ -89,13 +89,13 @@ public class Address implements Comparable<Address> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int compareTo(Address arg0) {
|
public int compareTo(Address arg0) {
|
||||||
return new Long(id).compareTo(arg0.getId());
|
return new Integer(id).compareTo(arg0.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return The unique id of the address.
|
* @return The unique id of the address.
|
||||||
*/
|
*/
|
||||||
public long getId() {
|
public int getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,7 +128,7 @@ public class Address implements Comparable<Address> {
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
final int prime = 31;
|
final int prime = 31;
|
||||||
int result = 1;
|
int result = 1;
|
||||||
result = prime * result + (int) (id ^ (id >>> 32));
|
result = prime * result + (id ^ (id >>> 32));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,9 +33,9 @@ public class BillingItemVirtualGuest implements Comparable<BillingItemVirtualGue
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder {
|
public static class Builder {
|
||||||
private long id = -1;
|
private int id = -1;
|
||||||
|
|
||||||
public Builder id(long id) {
|
public Builder id(int id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -45,26 +45,26 @@ public class BillingItemVirtualGuest implements Comparable<BillingItemVirtualGue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private long id = -1;
|
private int id = -1;
|
||||||
|
|
||||||
// for deserializer
|
// for deserializer
|
||||||
BillingItemVirtualGuest() {
|
BillingItemVirtualGuest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public BillingItemVirtualGuest(long id) {
|
public BillingItemVirtualGuest(int id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int compareTo(BillingItemVirtualGuest arg0) {
|
public int compareTo(BillingItemVirtualGuest arg0) {
|
||||||
return new Long(id).compareTo(arg0.getId());
|
return new Integer(id).compareTo(arg0.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return The unique identifier for this billing item.
|
* @return The unique identifier for this billing item.
|
||||||
*/
|
*/
|
||||||
public long getId() {
|
public int getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ public class BillingItemVirtualGuest implements Comparable<BillingItemVirtualGue
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
final int prime = 31;
|
final int prime = 31;
|
||||||
int result = 1;
|
int result = 1;
|
||||||
result = prime * result + (int) (id ^ (id >>> 32));
|
result = prime * result + (id ^ (id >>> 32));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,12 +30,12 @@ public class Datacenter implements Comparable<Datacenter> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder {
|
public static class Builder {
|
||||||
private long id = -1;
|
private int id = -1;
|
||||||
private String name;
|
private String name;
|
||||||
private String longName;
|
private String longName;
|
||||||
private Address locationAddress;
|
private Address locationAddress;
|
||||||
|
|
||||||
public Builder id(long id) {
|
public Builder id(int id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ public class Datacenter implements Comparable<Datacenter> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private long id = -1;
|
private int id = -1;
|
||||||
private String name;
|
private String name;
|
||||||
private String longName;
|
private String longName;
|
||||||
private Address locationAddress;
|
private Address locationAddress;
|
||||||
|
@ -74,7 +74,7 @@ public class Datacenter implements Comparable<Datacenter> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Datacenter(long id, String name, String longName, Address locationAddress) {
|
public Datacenter(int id, String name, String longName, Address locationAddress) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.longName = longName;
|
this.longName = longName;
|
||||||
|
@ -83,13 +83,13 @@ public class Datacenter implements Comparable<Datacenter> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int compareTo(Datacenter arg0) {
|
public int compareTo(Datacenter arg0) {
|
||||||
return new Long(id).compareTo(arg0.getId());
|
return new Integer(id).compareTo(arg0.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return The unique identifier of a specific location.
|
* @return The unique identifier of a specific location.
|
||||||
*/
|
*/
|
||||||
public long getId() {
|
public int getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ public class Datacenter implements Comparable<Datacenter> {
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
final int prime = 31;
|
final int prime = 31;
|
||||||
int result = 1;
|
int result = 1;
|
||||||
result = prime * result + (int) (id ^ (id >>> 32));
|
result = prime * result + (id ^ (id >>> 32));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,14 +44,14 @@ public class ProductItem implements Comparable<ProductItem> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder {
|
public static class Builder {
|
||||||
private long id = -1;
|
private int id = -1;
|
||||||
private String description;
|
private String description;
|
||||||
private String units;
|
private String units;
|
||||||
private Float capacity;
|
private Float capacity;
|
||||||
private Set<ProductItemPrice> prices = Sets.newLinkedHashSet();
|
private Set<ProductItemPrice> prices = Sets.newLinkedHashSet();
|
||||||
private Set<ProductItemCategory> categories = Sets.newLinkedHashSet();
|
private Set<ProductItemCategory> categories = Sets.newLinkedHashSet();
|
||||||
|
|
||||||
public Builder id(long id) {
|
public Builder id(int id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -105,7 +105,7 @@ public class ProductItem implements Comparable<ProductItem> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private long id = -1;
|
private int id = -1;
|
||||||
private String description;
|
private String description;
|
||||||
private String units;
|
private String units;
|
||||||
private Float capacity;
|
private Float capacity;
|
||||||
|
@ -117,7 +117,7 @@ public class ProductItem implements Comparable<ProductItem> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ProductItem(long id, String description, String units, Float capacity,
|
public ProductItem(int id, String description, String units, Float capacity,
|
||||||
Iterable<ProductItemPrice> prices, Iterable<ProductItemCategory> categories) {
|
Iterable<ProductItemPrice> prices, Iterable<ProductItemCategory> categories) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.description = description;
|
this.description = description;
|
||||||
|
@ -129,13 +129,13 @@ public class ProductItem implements Comparable<ProductItem> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int compareTo(ProductItem arg0) {
|
public int compareTo(ProductItem arg0) {
|
||||||
return new Long(id).compareTo(arg0.getId());
|
return new Integer(id).compareTo(arg0.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return The unique identifier of a specific location.
|
* @return The unique identifier of a specific location.
|
||||||
*/
|
*/
|
||||||
public long getId() {
|
public int getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -188,7 +188,7 @@ public class ProductItem implements Comparable<ProductItem> {
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
final int prime = 31;
|
final int prime = 31;
|
||||||
int result = 1;
|
int result = 1;
|
||||||
result = prime * result + (int) (id ^ (id >>> 32));
|
result = prime * result + (id ^ (id >>> 32));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,11 +36,11 @@ public class ProductItemCategory implements Comparable<ProductItemCategory> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder {
|
public static class Builder {
|
||||||
private long id = -1;
|
private int id = -1;
|
||||||
private String name;
|
private String name;
|
||||||
private String categoryCode;
|
private String categoryCode;
|
||||||
|
|
||||||
public Builder id(long id) {
|
public Builder id(int id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ public class ProductItemCategory implements Comparable<ProductItemCategory> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private long id = -1;
|
private int id = -1;
|
||||||
private String name;
|
private String name;
|
||||||
private String categoryCode;
|
private String categoryCode;
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ public class ProductItemCategory implements Comparable<ProductItemCategory> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ProductItemCategory(long id, String name, String categoryCode) {
|
public ProductItemCategory(int id, String name, String categoryCode) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.categoryCode = categoryCode;
|
this.categoryCode = categoryCode;
|
||||||
|
@ -83,13 +83,13 @@ public class ProductItemCategory implements Comparable<ProductItemCategory> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int compareTo(ProductItemCategory arg0) {
|
public int compareTo(ProductItemCategory arg0) {
|
||||||
return new Long(id).compareTo(arg0.getId());
|
return new Integer(id).compareTo(arg0.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return The unique identifier of a specific location.
|
* @return The unique identifier of a specific location.
|
||||||
*/
|
*/
|
||||||
public long getId() {
|
public int getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,7 +115,7 @@ public class ProductItemCategory implements Comparable<ProductItemCategory> {
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
final int prime = 31;
|
final int prime = 31;
|
||||||
int result = 1;
|
int result = 1;
|
||||||
result = prime * result + (int) (id ^ (id >>> 32));
|
result = prime * result + (id ^ (id >>> 32));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,12 +40,12 @@ public class ProductItemPrice implements Comparable<ProductItemPrice> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder {
|
public static class Builder {
|
||||||
private long id = -1;
|
private int id = -1;
|
||||||
private long itemId = -1;
|
private long itemId = -1;
|
||||||
private Float recurringFee;
|
private Float recurringFee;
|
||||||
private Float hourlyRecurringFee;
|
private Float hourlyRecurringFee;
|
||||||
|
|
||||||
public Builder id(long id) {
|
public Builder id(int id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ public class ProductItemPrice implements Comparable<ProductItemPrice> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private long id = -1;
|
private int id = -1;
|
||||||
private long itemId = -1;
|
private long itemId = -1;
|
||||||
private Float recurringFee;
|
private Float recurringFee;
|
||||||
private Float hourlyRecurringFee;
|
private Float hourlyRecurringFee;
|
||||||
|
@ -85,7 +85,7 @@ public class ProductItemPrice implements Comparable<ProductItemPrice> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ProductItemPrice(long id, long itemId, Float recurringFee, Float hourlyRecurringFee) {
|
public ProductItemPrice(int id, long itemId, Float recurringFee, Float hourlyRecurringFee) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.itemId = itemId;
|
this.itemId = itemId;
|
||||||
this.recurringFee = recurringFee;
|
this.recurringFee = recurringFee;
|
||||||
|
@ -94,13 +94,13 @@ public class ProductItemPrice implements Comparable<ProductItemPrice> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int compareTo(ProductItemPrice arg0) {
|
public int compareTo(ProductItemPrice arg0) {
|
||||||
return new Long(id).compareTo(arg0.getId());
|
return new Integer(id).compareTo(arg0.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return The unique identifier of a Product Item Price.
|
* @return The unique identifier of a Product Item Price.
|
||||||
*/
|
*/
|
||||||
public long getId() {
|
public int getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -154,6 +154,6 @@ public class ProductItemPrice implements Comparable<ProductItemPrice> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return (int) (id ^ (id >>> 32));
|
return (id ^ (id >>> 32));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,14 +38,14 @@ public class ProductOrder {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder {
|
public static class Builder {
|
||||||
private long packageId = -1;
|
private int packageId = -1;
|
||||||
private Set<ProductItemPrice> prices = Sets.newLinkedHashSet();
|
private Set<ProductItemPrice> prices = Sets.newLinkedHashSet();
|
||||||
private Set<VirtualGuest> virtualGuests = Sets.newLinkedHashSet();
|
private Set<VirtualGuest> virtualGuests = Sets.newLinkedHashSet();
|
||||||
private String location;
|
private String location;
|
||||||
private long quantity;
|
private int quantity;
|
||||||
private boolean useHourlyPricing;
|
private boolean useHourlyPricing;
|
||||||
|
|
||||||
public Builder packageId(long packageId) {
|
public Builder packageId(int packageId) {
|
||||||
this.packageId = packageId;
|
this.packageId = packageId;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -92,7 +92,7 @@ public class ProductOrder {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder quantity(long quantity) {
|
public Builder quantity(int quantity) {
|
||||||
this.quantity = quantity;
|
this.quantity = quantity;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -116,11 +116,11 @@ public class ProductOrder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private long packageId = -1;
|
private int packageId = -1;
|
||||||
private String location;
|
private String location;
|
||||||
private Set<ProductItemPrice> prices = Sets.newLinkedHashSet();
|
private Set<ProductItemPrice> prices = Sets.newLinkedHashSet();
|
||||||
private Set<VirtualGuest> virtualGuests = Sets.newLinkedHashSet();
|
private Set<VirtualGuest> virtualGuests = Sets.newLinkedHashSet();
|
||||||
private long quantity;
|
private int quantity;
|
||||||
private boolean useHourlyPricing;
|
private boolean useHourlyPricing;
|
||||||
|
|
||||||
// for deserializer
|
// for deserializer
|
||||||
|
@ -128,7 +128,7 @@ public class ProductOrder {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ProductOrder(long packageId, String location, Iterable<ProductItemPrice> prices, Iterable<VirtualGuest> virtualGuest, long quantity, boolean useHourlyPricing) {
|
public ProductOrder(int packageId, String location, Iterable<ProductItemPrice> prices, Iterable<VirtualGuest> virtualGuest, int quantity, boolean useHourlyPricing) {
|
||||||
this.packageId = packageId;
|
this.packageId = packageId;
|
||||||
this.location = checkNotNull(emptyToNull(location),"location cannot be null or empty:"+location);
|
this.location = checkNotNull(emptyToNull(location),"location cannot be null or empty:"+location);
|
||||||
this.prices = ImmutableSet.<ProductItemPrice> copyOf(checkNotNull(prices, "prices"));
|
this.prices = ImmutableSet.<ProductItemPrice> copyOf(checkNotNull(prices, "prices"));
|
||||||
|
@ -140,7 +140,7 @@ public class ProductOrder {
|
||||||
/**
|
/**
|
||||||
* @return The package id of an order. This is required.
|
* @return The package id of an order. This is required.
|
||||||
*/
|
*/
|
||||||
public long getPackageId() {
|
public int getPackageId() {
|
||||||
return packageId;
|
return packageId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,7 +168,7 @@ public class ProductOrder {
|
||||||
return virtualGuests;
|
return virtualGuests;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getQuantity() {
|
public int getQuantity() {
|
||||||
return quantity;
|
return quantity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -202,11 +202,11 @@ public class ProductOrder {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
int result = (int) (packageId ^ (packageId >>> 32));
|
int result = (packageId ^ (packageId >>> 32));
|
||||||
result = 31 * result + (location != null ? location.hashCode() : 0);
|
result = 31 * result + (location != null ? location.hashCode() : 0);
|
||||||
result = 31 * result + (prices != null ? prices.hashCode() : 0);
|
result = 31 * result + (prices != null ? prices.hashCode() : 0);
|
||||||
result = 31 * result + (virtualGuests != null ? virtualGuests.hashCode() : 0);
|
result = 31 * result + (virtualGuests != null ? virtualGuests.hashCode() : 0);
|
||||||
result = 31 * result + (int) (quantity ^ (quantity >>> 32));
|
result = 31 * result + (quantity ^ (quantity >>> 32));
|
||||||
result = 31 * result + (useHourlyPricing ? 1 : 0);
|
result = 31 * result + (useHourlyPricing ? 1 : 0);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,9 +30,9 @@ public class ProductOrderReceipt implements Comparable<ProductOrderReceipt> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder {
|
public static class Builder {
|
||||||
private long orderId = -1;
|
private int orderId = -1;
|
||||||
|
|
||||||
public Builder orderId(long orderId) {
|
public Builder orderId(int orderId) {
|
||||||
this.orderId = orderId;
|
this.orderId = orderId;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -46,26 +46,26 @@ public class ProductOrderReceipt implements Comparable<ProductOrderReceipt> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private long orderId = -1;
|
private int orderId = -1;
|
||||||
|
|
||||||
// for deserializer
|
// for deserializer
|
||||||
ProductOrderReceipt() {
|
ProductOrderReceipt() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ProductOrderReceipt(long orderId) {
|
public ProductOrderReceipt(int orderId) {
|
||||||
this.orderId = orderId;
|
this.orderId = orderId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int compareTo(ProductOrderReceipt arg0) {
|
public int compareTo(ProductOrderReceipt arg0) {
|
||||||
return new Long(orderId).compareTo(arg0.getOrderId());
|
return new Integer(orderId).compareTo(arg0.getOrderId());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return unique identifier for the order.
|
* @return unique identifier for the order.
|
||||||
*/
|
*/
|
||||||
public long getOrderId() {
|
public int getOrderId() {
|
||||||
return orderId;
|
return orderId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ public class ProductOrderReceipt implements Comparable<ProductOrderReceipt> {
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
final int prime = 31;
|
final int prime = 31;
|
||||||
int result = 1;
|
int result = 1;
|
||||||
result = prime * result + (int) (orderId ^ (orderId >>> 32));
|
result = prime * result + (orderId ^ (orderId >>> 32));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,13 +45,13 @@ public class ProductPackage implements Comparable<ProductPackage> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder {
|
public static class Builder {
|
||||||
private long id = -1;
|
private int id = -1;
|
||||||
private String name;
|
private String name;
|
||||||
private String description;
|
private String description;
|
||||||
private Set<ProductItem> items = Sets.newLinkedHashSet();
|
private Set<ProductItem> items = Sets.newLinkedHashSet();
|
||||||
private Set<Datacenter> datacenters = Sets.newLinkedHashSet();
|
private Set<Datacenter> datacenters = Sets.newLinkedHashSet();
|
||||||
|
|
||||||
public Builder id(long id) {
|
public Builder id(int id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -89,7 +89,7 @@ public class ProductPackage implements Comparable<ProductPackage> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private long id = -1;
|
private int id = -1;
|
||||||
private String name;
|
private String name;
|
||||||
private String description;
|
private String description;
|
||||||
private Set<ProductItem> items = Sets.newLinkedHashSet();
|
private Set<ProductItem> items = Sets.newLinkedHashSet();
|
||||||
|
@ -100,7 +100,7 @@ public class ProductPackage implements Comparable<ProductPackage> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ProductPackage(long id, String name, String description, Iterable<ProductItem> items, Iterable<Datacenter> datacenters) {
|
public ProductPackage(int id, String name, String description, Iterable<ProductItem> items, Iterable<Datacenter> datacenters) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.description = description;
|
this.description = description;
|
||||||
|
@ -110,14 +110,14 @@ public class ProductPackage implements Comparable<ProductPackage> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int compareTo(ProductPackage arg0) {
|
public int compareTo(ProductPackage arg0) {
|
||||||
return new Long(id).compareTo(arg0.getId());
|
return new Integer(id).compareTo(arg0.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return A package's internal identifier. Everything regarding a
|
* @return A package's internal identifier. Everything regarding a
|
||||||
* SoftLayer_Product_Package is tied back to this id.
|
* SoftLayer_Product_Package is tied back to this id.
|
||||||
*/
|
*/
|
||||||
public long getId() {
|
public int getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,7 +163,7 @@ public class ProductPackage implements Comparable<ProductPackage> {
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
final int prime = 31;
|
final int prime = 31;
|
||||||
int result = 1;
|
int result = 1;
|
||||||
result = prime * result + (int) (id ^ (id >>> 32));
|
result = prime * result + (id ^ (id >>> 32));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ import com.google.gson.annotations.SerializedName;
|
||||||
*
|
*
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
* @see <a href=
|
* @see <a href=
|
||||||
* "http://sldn.softlayer.com/reference/datatypes/SoftLayer_Virtual_Guest#Local_Properties"
|
* "http://sldn.softlayer.com/reference/datatypes/SoftLayer_Virtual_Guest"
|
||||||
* />
|
* />
|
||||||
*/
|
*/
|
||||||
public class VirtualGuest implements Comparable<VirtualGuest> {
|
public class VirtualGuest implements Comparable<VirtualGuest> {
|
||||||
|
@ -43,8 +43,8 @@ public class VirtualGuest implements Comparable<VirtualGuest> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder {
|
public static class Builder {
|
||||||
private long id = -1;
|
private int id = -1;
|
||||||
private long accountId = -1;
|
private int accountId = -1;
|
||||||
private Date createDate;
|
private Date createDate;
|
||||||
private boolean dedicatedAccountHostOnly;
|
private boolean dedicatedAccountHostOnly;
|
||||||
private String hostname;
|
private String hostname;
|
||||||
|
@ -65,12 +65,12 @@ public class VirtualGuest implements Comparable<VirtualGuest> {
|
||||||
private String primaryIpAddress;
|
private String primaryIpAddress;
|
||||||
private BillingItemVirtualGuest billingItem;
|
private BillingItemVirtualGuest billingItem;
|
||||||
|
|
||||||
public Builder id(long id) {
|
public Builder id(int id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder accountId(long accountId) {
|
public Builder accountId(int accountId) {
|
||||||
this.accountId = accountId;
|
this.accountId = accountId;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -221,14 +221,14 @@ public class VirtualGuest implements Comparable<VirtualGuest> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private long accountId = -1;
|
private int accountId = -1;
|
||||||
private Date createDate;
|
private Date createDate;
|
||||||
@SerializedName("dedicatedAccountHostOnlyFlag")
|
@SerializedName("dedicatedAccountHostOnlyFlag")
|
||||||
private boolean dedicatedAccountHostOnly;
|
private boolean dedicatedAccountHostOnly;
|
||||||
private String domain;
|
private String domain;
|
||||||
private String fullyQualifiedDomainName;
|
private String fullyQualifiedDomainName;
|
||||||
private String hostname;
|
private String hostname;
|
||||||
private long id = -1;
|
private int id = -1;
|
||||||
private Date lastVerifiedDate;
|
private Date lastVerifiedDate;
|
||||||
private int maxCpu = -1;
|
private int maxCpu = -1;
|
||||||
private String maxCpuUnits;
|
private String maxCpuUnits;
|
||||||
|
@ -251,8 +251,8 @@ public class VirtualGuest implements Comparable<VirtualGuest> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public VirtualGuest(long accountId, Date createDate, boolean dedicatedAccountHostOnly, String domain,
|
public VirtualGuest(int accountId, Date createDate, boolean dedicatedAccountHostOnly, String domain,
|
||||||
String fullyQualifiedDomainName, String hostname, long id, Date lastVerifiedDate, int maxCpu,
|
String fullyQualifiedDomainName, String hostname, int id, Date lastVerifiedDate, int maxCpu,
|
||||||
String maxCpuUnits, int maxMemory, Date metricPollDate, Date modifyDate, String notes,
|
String maxCpuUnits, int maxMemory, Date metricPollDate, Date modifyDate, String notes,
|
||||||
boolean privateNetworkOnly, int startCpus, int statusId, String uuid, String primaryBackendIpAddress,
|
boolean privateNetworkOnly, int startCpus, int statusId, String uuid, String primaryBackendIpAddress,
|
||||||
String primaryIpAddress,BillingItemVirtualGuest billingItem) {
|
String primaryIpAddress,BillingItemVirtualGuest billingItem) {
|
||||||
|
@ -281,13 +281,13 @@ public class VirtualGuest implements Comparable<VirtualGuest> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int compareTo(VirtualGuest arg0) {
|
public int compareTo(VirtualGuest arg0) {
|
||||||
return new Long(id).compareTo(arg0.getId());
|
return new Integer(id).compareTo(arg0.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return A computing instance's associated account id
|
* @return A computing instance's associated account id
|
||||||
*/
|
*/
|
||||||
public long getAccountId() {
|
public int getAccountId() {
|
||||||
return accountId;
|
return accountId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -330,7 +330,7 @@ public class VirtualGuest implements Comparable<VirtualGuest> {
|
||||||
/**
|
/**
|
||||||
* @return Unique ID for a computing instance.
|
* @return Unique ID for a computing instance.
|
||||||
*/
|
*/
|
||||||
public long getId() {
|
public int getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -438,13 +438,13 @@ public class VirtualGuest implements Comparable<VirtualGuest> {
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
final int prime = 31;
|
final int prime = 31;
|
||||||
int result = 1;
|
int result = 1;
|
||||||
result = prime * result + (int) (accountId ^ (accountId >>> 32));
|
result = prime * result + (accountId ^ (accountId >>> 32));
|
||||||
result = prime * result + ((createDate == null) ? 0 : createDate.hashCode());
|
result = prime * result + ((createDate == null) ? 0 : createDate.hashCode());
|
||||||
result = prime * result + (dedicatedAccountHostOnly ? 1231 : 1237);
|
result = prime * result + (dedicatedAccountHostOnly ? 1231 : 1237);
|
||||||
result = prime * result + ((domain == null) ? 0 : domain.hashCode());
|
result = prime * result + ((domain == null) ? 0 : domain.hashCode());
|
||||||
result = prime * result + ((fullyQualifiedDomainName == null) ? 0 : fullyQualifiedDomainName.hashCode());
|
result = prime * result + ((fullyQualifiedDomainName == null) ? 0 : fullyQualifiedDomainName.hashCode());
|
||||||
result = prime * result + ((hostname == null) ? 0 : hostname.hashCode());
|
result = prime * result + ((hostname == null) ? 0 : hostname.hashCode());
|
||||||
result = prime * result + (int) (id ^ (id >>> 32));
|
result = prime * result + (id ^ (id >>> 32));
|
||||||
result = prime * result + ((lastVerifiedDate == null) ? 0 : lastVerifiedDate.hashCode());
|
result = prime * result + ((lastVerifiedDate == null) ? 0 : lastVerifiedDate.hashCode());
|
||||||
result = prime * result + maxCpu;
|
result = prime * result + maxCpu;
|
||||||
result = prime * result + ((maxCpuUnits == null) ? 0 : maxCpuUnits.hashCode());
|
result = prime * result + ((maxCpuUnits == null) ? 0 : maxCpuUnits.hashCode());
|
||||||
|
|
|
@ -35,15 +35,15 @@ public interface SoftLayerConstants {
|
||||||
public static final String PROPERTY_SOFTLAYER_VIRTUALGUEST_PACKAGE_NAME = "jclouds.softlayer.virtualguest.package-name";
|
public static final String PROPERTY_SOFTLAYER_VIRTUALGUEST_PACKAGE_NAME = "jclouds.softlayer.virtualguest.package-name";
|
||||||
|
|
||||||
public static final Set<ProductItemPrice> DEFAULT_VIRTUAL_GUEST_PRICES = ImmutableSet.<ProductItemPrice>builder()
|
public static final Set<ProductItemPrice> DEFAULT_VIRTUAL_GUEST_PRICES = ImmutableSet.<ProductItemPrice>builder()
|
||||||
.add(ProductItemPrice.builder().id(1639L).build()) // 100 GB (SAN)
|
.add(ProductItemPrice.builder().id(1639).build()) // 100 GB (SAN)
|
||||||
.add(ProductItemPrice.builder().id(21L).build()) // 1 IP Address
|
.add(ProductItemPrice.builder().id(21).build()) // 1 IP Address
|
||||||
.add(ProductItemPrice.builder().id(55L).build()) // Host Ping
|
.add(ProductItemPrice.builder().id(55).build()) // Host Ping
|
||||||
.add(ProductItemPrice.builder().id(58L).build()) // Automated Notification
|
.add(ProductItemPrice.builder().id(58).build()) // Automated Notification
|
||||||
.add(ProductItemPrice.builder().id(1800L).build()) // 0 GB Bandwidth
|
.add(ProductItemPrice.builder().id(1800).build()) // 0 GB Bandwidth
|
||||||
.add(ProductItemPrice.builder().id(57L).build()) // Email and Ticket
|
.add(ProductItemPrice.builder().id(57).build()) // Email and Ticket
|
||||||
.add(ProductItemPrice.builder().id(274L).build()) // 1000 Mbps Public & Private Networks
|
.add(ProductItemPrice.builder().id(274).build()) // 1000 Mbps Public & Private Networks
|
||||||
.add(ProductItemPrice.builder().id(905L).build()) // Reboot / Remote Console
|
.add(ProductItemPrice.builder().id(905).build()) // Reboot / Remote Console
|
||||||
.add(ProductItemPrice.builder().id(418L).build()) // Nessus Vulnerability Assessment & Reporting
|
.add(ProductItemPrice.builder().id(418).build()) // Nessus Vulnerability Assessment & Reporting
|
||||||
.add(ProductItemPrice.builder().id(420L).build()) // Unlimited SSL VPN Users & 1 PPTP VPN User per account
|
.add(ProductItemPrice.builder().id(420).build()) // Unlimited SSL VPN Users & 1 PPTP VPN User per account
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,7 +59,7 @@ public class ProductPackageClientLiveTest extends BaseSoftLayerClientLiveTest {
|
||||||
private ProductPackageClient client;
|
private ProductPackageClient client;
|
||||||
private AccountClient accountClient;
|
private AccountClient accountClient;
|
||||||
|
|
||||||
private long cloudServerPackageId;
|
private int cloudServerPackageId;
|
||||||
private ProductPackage cloudServerProductPackage;
|
private ProductPackage cloudServerProductPackage;
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -119,7 +119,7 @@ public class ProductPackageClientLiveTest extends BaseSoftLayerClientLiveTest {
|
||||||
Map<Float, ProductItem> ramToProductItem = Maps.uniqueIndex(ramItems, ProductItems.capacity());
|
Map<Float, ProductItem> ramToProductItem = Maps.uniqueIndex(ramItems, ProductItems.capacity());
|
||||||
|
|
||||||
ProductItemPrice price = ProductItems.price().apply(ramToProductItem.get(1.0f));
|
ProductItemPrice price = ProductItems.price().apply(ramToProductItem.get(1.0f));
|
||||||
assert new Long(1644L).equals(price.getId());
|
assert new Integer(1644).equals(price.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -131,7 +131,7 @@ public class ProductPackageClientLiveTest extends BaseSoftLayerClientLiveTest {
|
||||||
Map<Float, ProductItem> coresToProductItem = Maps.uniqueIndex(cpuItems, ProductItems.capacity());
|
Map<Float, ProductItem> coresToProductItem = Maps.uniqueIndex(cpuItems, ProductItems.capacity());
|
||||||
|
|
||||||
ProductItemPrice price = ProductItems.price().apply(coresToProductItem.get(2.0f));
|
ProductItemPrice price = ProductItems.price().apply(coresToProductItem.get(2.0f));
|
||||||
assert new Long(1963L).equals(price.getId());
|
assert new Integer(1963).equals(price.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -141,7 +141,7 @@ public class ProductPackageClientLiveTest extends BaseSoftLayerClientLiveTest {
|
||||||
Map<String, ProductItem> osToProductItem = Maps.uniqueIndex(operatingSystems, ProductItems.description());
|
Map<String, ProductItem> osToProductItem = Maps.uniqueIndex(operatingSystems, ProductItems.description());
|
||||||
|
|
||||||
ProductItemPrice price = ProductItems.price().apply(osToProductItem.get("Ubuntu Linux 8 LTS Hardy Heron - Minimal Install (64 bit)"));
|
ProductItemPrice price = ProductItems.price().apply(osToProductItem.get("Ubuntu Linux 8 LTS Hardy Heron - Minimal Install (64 bit)"));
|
||||||
assert new Long(1693L).equals(price.getId());
|
assert new Integer(1693).equals(price.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue