Update toString methods

This commit is contained in:
vijaykiran 2011-12-07 15:01:41 +01:00
parent 2566c04c19
commit 8b06ee410d
39 changed files with 527 additions and 184 deletions

View File

@ -18,11 +18,12 @@
*/
package org.jclouds.cloudstack.domain;
import static com.google.common.base.Preconditions.checkNotNull;
import javax.annotation.Nullable;
import java.util.Map;
import java.util.Set;
import static com.google.common.base.Preconditions.checkNotNull;
import com.google.common.base.CaseFormat;
import com.google.common.base.Function;
import com.google.common.collect.ForwardingSet;
@ -598,15 +599,39 @@ public class Account extends ForwardingSet<User> implements Comparable<Account>
return new Long(id).compareTo(arg0.getId());
}
@Override
public String toString() {
return String
.format(
"[id=%s, name=%s, type=%s, state=%s, domain=%s, domainId=%s, cleanupRequired=%s, sentBytes=%s, receivedBytes=%s, IPs=%s, IPsAvailable=%s, IPLimit=%s, VMs=%s, VMsAvailable=%s, VMsRunning=%s, VMsStopped=%s, VMLimit=%s, snapshots=%s, snapshotLimit=%s, snapshotsAvailable=%s, templateLimit=%s, templates=%s, templatesAvailable=%s, volumes=%s, volumeLimit=%s, volumesAvailable=%s, users=%s]",
id, name, type, state, domain, domainId, cleanupRequired, sentBytes, receivedBytes, IPs,
IPsAvailable, IPLimit, VMs, VMsAvailable, VMsRunning, VMsStopped, VMLimit, snapshots, snapshotLimit,
snapshotsAvailable, templateLimit, templates, templatesAvailable, volumes, volumeLimit,
volumesAvailable, users);
return "Account{" +
"id=" + id +
", type=" + type +
", networkDomain='" + networkDomain + '\'' +
", domain='" + domain + '\'' +
", domainId=" + domainId +
", IPsAvailable=" + IPsAvailable +
", IPLimit=" + IPLimit +
", IPs=" + IPs +
", cleanupRequired=" + cleanupRequired +
", name='" + name + '\'' +
", receivedBytes=" + receivedBytes +
", sentBytes=" + sentBytes +
", snapshotsAvailable=" + snapshotsAvailable +
", snapshotLimit=" + snapshotLimit +
", snapshots=" + snapshots +
", state=" + state +
", templatesAvailable=" + templatesAvailable +
", templateLimit=" + templateLimit +
", templates=" + templates +
", VMsAvailable=" + VMsAvailable +
", VMLimit=" + VMLimit +
", VMsRunning=" + VMsRunning +
", VMsStopped=" + VMsStopped +
", VMs=" + VMs +
", volumesAvailable=" + volumesAvailable +
", volumeLimit=" + volumeLimit +
", volumes=" + volumes +
", users=" + users +
'}';
}
@Override

View File

@ -118,14 +118,15 @@ public class Alert implements Comparable<Alert> {
return result;
}
@Override
public String toString() {
return "Alert{" +
"id=" + id +
", description='" + description + '\'' +
", sent=" + sent +
", type='" + type + '\'' +
'}';
"id=" + id +
", description='" + description + '\'' +
", sent=" + sent +
", type='" + type + '\'' +
'}';
}
@Override

View File

@ -85,7 +85,10 @@ public class AsyncCreateResponse {
@Override
public String toString() {
return "[id=" + id + ", jobId=" + jobId + "]";
return "AsyncCreateResponse{" +
"id=" + id +
", jobId=" + jobId +
'}';
}
}

View File

@ -422,10 +422,21 @@ public class AsyncJob<T> {
@Override
public String toString() {
return "[accountId=" + accountId + ", cmd=" + cmd + ", created=" + created + ", id=" + id + ", instanceId="
+ instanceId + ", instanceType=" + instanceType + ", error=" + error + ", progress=" + progress
+ ", result=" + result + ", resultCode=" + resultCode + ", resultType=" + resultType + ", status=" + status
+ ", userId=" + userId + "]";
return "AsyncJob{" +
"accountId=" + accountId +
", cmd='" + cmd + '\'' +
", created=" + created +
", id=" + id +
", instanceId=" + instanceId +
", instanceType='" + instanceType + '\'' +
", progress=" + progress +
", result=" + result +
", resultCode=" + resultCode +
", resultType='" + resultType + '\'' +
", status=" + status +
", userId=" + userId +
", error=" + error +
'}';
}
}

View File

@ -120,7 +120,10 @@ public class AsyncJobError {
@Override
public String toString() {
return "[errorCode=" + errorCode + ", errorText=" + errorText + "]";
return "AsyncJobError{" +
"errorCode=" + errorCode +
", errorText='" + errorText + '\'' +
'}';
}
}

View File

@ -166,9 +166,12 @@ public class Capabilities {
@Override
public String toString() {
return "[cloudStackVersion=" + cloudStackVersion + ", canShareTemplates=" + canShareTemplates
+ ", securityGroupsEnabled=" + securityGroupsEnabled
+ ", firewallRuleUiEnabled=" + firewallRuleUiEnabled
+ ", supportELB=" + supportELB + "]";
return "Capabilities{" +
"cloudStackVersion='" + cloudStackVersion + '\'' +
", securityGroupsEnabled=" + securityGroupsEnabled +
", canShareTemplates=" + canShareTemplates +
", firewallRuleUiEnabled=" + firewallRuleUiEnabled +
", supportELB=" + supportELB +
'}';
}
}

View File

@ -231,16 +231,16 @@ public class Capacity implements Comparable<Capacity> {
@Override
public String toString() {
return "[" +
"podId=" + podId +
", podName='" + podName + '\'' +
", zoneId=" + zoneId +
", zoneName='" + zoneName + '\'' +
", type=" + type +
", capacityUsed=" + capacityUsed +
", capacityTotal=" + capacityTotal +
", percentUsed=" + percentUsed +
']';
return "Capacity{" +
"capacityTotal=" + capacityTotal +
", capacityUsed=" + capacityUsed +
", percentUsed=" + percentUsed +
", podId=" + podId +
", podName='" + podName + '\'' +
", type=" + type +
", zoneId=" + zoneId +
", zoneName='" + zoneName + '\'' +
'}';
}
@Override

View File

@ -270,9 +270,17 @@ public class DiskOffering implements Comparable<DiskOffering> {
@Override
public String toString() {
return "[id=" + id + ", name=" + name + ", displayText=" + displayText + ", created=" + created + ", diskSize="
+ diskSize + ", iscustomized=" + customized + ", domain=" + domain + ", domainId=" + domainId + ", tags="
+ getTags() + "]";
return "DiskOffering{" +
"id=" + id +
", name='" + name + '\'' +
", displayText='" + displayText + '\'' +
", created=" + created +
", domain='" + domain + '\'' +
", domainId=" + domainId +
", diskSize=" + diskSize +
", customized=" + customized +
", tags='" + tags + '\'' +
'}';
}
@Override

View File

@ -265,9 +265,19 @@ public class Event implements Comparable<Event> {
@Override
public String toString() {
return String.format("[id=%d, account=%s, description=%s, created=%s, domain=%s, domainId=%d, level=%s, " +
"parentId=%s, state=%s, type=%s, username=%s]",
id, account, description, created, domain, domainId, level, parentId, state, type, username);
return "Event{" +
"id=" + id +
", account='" + account + '\'' +
", description='" + description + '\'' +
", created=" + created +
", domain='" + domain + '\'' +
", domainId=" + domainId +
", level='" + level + '\'' +
", parentId='" + parentId + '\'' +
", state='" + state + '\'' +
", type='" + type + '\'' +
", username='" + username + '\'' +
'}';
}

View File

@ -18,10 +18,11 @@
*/
package org.jclouds.cloudstack.domain;
import java.util.HashSet;
import java.util.Collections;
import java.util.Set;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
import com.google.gson.annotations.SerializedName;
/**
@ -168,7 +169,7 @@ public class IPForwardingRule implements Comparable<IPForwardingRule> {
this.virtualMachineDisplayName = virtualMachineDisplayName;
this.virtualMachineId = virtualMachineId;
this.virtualMachineName = virtualMachineName;
this.CIDRs = new HashSet<String>(CIDRs);
this.CIDRs = Sets.newHashSet(CIDRs);
this.privateEndPort = privateEndPort;
this.publicEndPort = publicEndPort;
this.publicPort = publicPort;
@ -261,7 +262,7 @@ public class IPForwardingRule implements Comparable<IPForwardingRule> {
* @return the cidr list to forward traffic from
*/
public Set<String> getCIDRs() {
return CIDRs;
return Collections.unmodifiableSet(CIDRs);
}
/**

View File

@ -689,7 +689,7 @@ public class ISO implements Comparable<ISO> {
@Override
public String toString() {
return "[" +
return "ISO{" +
"id=" + id +
", account='" + account + '\'' +
", accountId=" + accountId +
@ -722,7 +722,7 @@ public class ISO implements Comparable<ISO> {
", templateType='" + templateType + '\'' +
", zoneId=" + zoneId +
", zoneName='" + zoneName + '\'' +
']';
'}';
}
@Override

View File

@ -313,21 +313,21 @@ public class ISOExtraction implements Comparable<ISOExtraction> {
@Override
public String toString() {
return "[" +
"id=" + id +
", accountId=" + accountId +
", created=" + created +
", extractId=" + extractId +
", extractMode=" + extractMode +
", name='" + name + '\'' +
", state='" + state + '\'' +
", status='" + status + '\'' +
", storageType='" + storageType + '\'' +
", uploadPercentage=" + uploadPercentage +
", url='" + url + '\'' +
", zoneId=" + zoneId +
", zoneName='" + zoneName + '\'' +
']';
return "ISOExtraction{" +
"id=" + id +
", accountId=" + accountId +
", created=" + created +
", extractId=" + extractId +
", extractMode=" + extractMode +
", name='" + name + '\'' +
", state='" + state + '\'' +
", status='" + status + '\'' +
", storageType='" + storageType + '\'' +
", uploadPercentage=" + uploadPercentage +
", url='" + url + '\'' +
", zoneId=" + zoneId +
", zoneName='" + zoneName + '\'' +
'}';
}
@Override

View File

@ -137,12 +137,12 @@ public class ISOPermissions implements Comparable<ISOPermissions> {
@Override
public String toString() {
return "[" +
"id=" + id +
", account='" + account + '\'' +
", domainId=" + domainId +
", isPublic=" + isPublic +
']';
return "ISOPermissions{" +
"id=" + id +
", account='" + account + '\'' +
", domainId=" + domainId +
", isPublic=" + isPublic +
'}';
}
@Override

View File

@ -256,9 +256,17 @@ public class IngressRule implements Comparable<IngressRule> {
@Override
public String toString() {
return "[id=" + id + ", securityGroupName=" + securityGroupName + ", account=" + account + ", startPort="
+ startPort + ", endPort=" + endPort + ", protocol=" + protocol + ", CIDR=" + CIDR + ", ICMPCode="
+ ICMPCode + ", ICMPType=" + ICMPType + "]";
return "IngressRule{" +
"account='" + account + '\'' +
", CIDR='" + CIDR + '\'' +
", endPort=" + endPort +
", ICMPCode=" + ICMPCode +
", ICMPType=" + ICMPType +
", protocol='" + protocol + '\'' +
", id=" + id +
", securityGroupName='" + securityGroupName + '\'' +
", startPort=" + startPort +
'}';
}
@Override

View File

@ -57,10 +57,10 @@ public class JobResult implements Comparable<JobResult> {
@Override
public String toString() {
return "[" +
"success=" + success +
", displayText=" + (displayText != null ? '\'' + displayText + '\'' : "null") +
']';
return "JobResult{" +
"success=" + success +
", displayText='" + displayText + '\'' +
'}';
}
@Override

View File

@ -25,6 +25,7 @@ import java.util.Set;
import com.google.common.base.CaseFormat;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
import com.google.gson.annotations.SerializedName;
/**
@ -205,6 +206,9 @@ public class LoadBalancerRule implements Comparable<LoadBalancerRule> {
this.publicIPId = publicIPId;
this.publicPort = publicPort;
this.state = state;
this.zoneId = zoneId;
this.CIDRs = Sets.newHashSet(CIDRs);
}
/**
@ -392,10 +396,22 @@ public class LoadBalancerRule implements Comparable<LoadBalancerRule> {
@Override
public String toString() {
return "[account=" + account + ", algorithm=" + algorithm + ", description=" + description + ", domain=" + domain
+ ", domainId=" + domainId + ", zoneId=" + zoneId + ", id=" + id + ", name=" + name + ", privatePort=" + privatePort
+ ", publicIP=" + publicIP + ", publicIPId=" + publicIPId + ", publicPort=" + publicPort + ", state="
+ state + "]";
return "LoadBalancerRule{" +
"id=" + id +
", account='" + account + '\'' +
", algorithm=" + algorithm +
", description='" + description + '\'' +
", domain='" + domain + '\'' +
", domainId=" + domainId +
", name='" + name + '\'' +
", privatePort=" + privatePort +
", publicIP='" + publicIP + '\'' +
", publicIPId=" + publicIPId +
", publicPort=" + publicPort +
", state=" + state +
", CIDRs=" + CIDRs +
", zoneId=" + zoneId +
'}';
}
}

View File

@ -297,9 +297,19 @@ public class NIC {
@Override
public String toString() {
return "[id=" + id + ", broadcastURI=" + broadcastURI + ", gateway=" + gateway + ", IPAddress=" + IPAddress
+ ", isDefault=" + isDefault + ", isolationURI=" + isolationURI + ", netmask=" + netmask + ", MACAddress="
+ macAddress + ", networkId=" + networkId + ", trafficType=" + trafficType + ", guestIPType=" + guestIPType + "]";
return "NIC{" +
"id=" + id +
", broadcastURI=" + broadcastURI +
", gateway='" + gateway + '\'' +
", IPAddress='" + IPAddress + '\'' +
", isDefault=" + isDefault +
", isolationURI=" + isolationURI +
", netmask='" + netmask + '\'' +
", macAddress='" + macAddress + '\'' +
", networkId=" + networkId +
", trafficType=" + trafficType +
", guestIPType=" + guestIPType +
'}';
}
}

View File

@ -281,11 +281,11 @@ public class Network implements Comparable<Network> {
private TrafficType trafficType;
@SerializedName("zoneid")
private long zoneId;
@SerializedName("service")
private String tags;
@SerializedName("securitygroupenabled")
private boolean securityGroupEnabled;
// so tests and serialization comes out expected
@SerializedName("service")
private SortedSet<? extends NetworkService> services = ImmutableSortedSet.<NetworkService>of();
/**
@ -715,15 +715,39 @@ public class Network implements Comparable<Network> {
@Override
public String toString() {
return "[id=" + id + ", state=" + state + ", name=" + name + ", displayText=" + displayText + ", guestIPType="
+ guestIPType + ", trafficType=" + trafficType + ", DNS=" + getDNS() + ", VLAN=" + VLAN
+ ", startIP=" + startIP + ", endIP=" + endIP + ", netmask=" + netmask + ", gateway=" + gateway
+ ", broadcastDomainType=" + broadcastDomainType + ", broadcastURI=" + broadcastURI + ", services="
+ services + ", domain=" + domain + ", domainId=" + domainId + ", isDefault=" + isDefault + ", isShared="
+ isShared + ", isSystem=" + isSystem + ", related=" + related + ", zoneId=" + zoneId + ", domain="
+ networkDomain + ", networkOfferingAvailability=" + networkOfferingAvailability
+ ", networkOfferingDisplayText=" + networkOfferingDisplayText + ", networkOfferingId=" + networkOfferingId
+ ", networkOfferingName=" + networkOfferingName + ", tags=" + getTags() + "]";
return "Network{" +
"id=" + id +
", account='" + account + '\'' +
", broadcastDomainType='" + broadcastDomainType + '\'' +
", broadcastURI=" + broadcastURI +
", displayText='" + displayText + '\'' +
", DNS1='" + DNS1 + '\'' +
", DNS2='" + DNS2 + '\'' +
", domain='" + domain + '\'' +
", domainId=" + domainId +
", endIP='" + endIP + '\'' +
", gateway='" + gateway + '\'' +
", isDefault=" + isDefault +
", isShared=" + isShared +
", isSystem=" + isSystem +
", netmask='" + netmask + '\'' +
", networkDomain='" + networkDomain + '\'' +
", networkOfferingAvailability='" + networkOfferingAvailability + '\'' +
", networkOfferingDisplayText='" + networkOfferingDisplayText + '\'' +
", networkOfferingId=" + networkOfferingId +
", networkOfferingName='" + networkOfferingName + '\'' +
", related=" + related +
", startIP='" + startIP + '\'' +
", name='" + name + '\'' +
", state='" + state + '\'' +
", guestIPType=" + guestIPType +
", VLAN='" + VLAN + '\'' +
", trafficType=" + trafficType +
", zoneId=" + zoneId +
", tags='" + tags + '\'' +
", securityGroupEnabled=" + securityGroupEnabled +
", services=" + services +
'}';
}
@Override

View File

@ -334,9 +334,20 @@ public class NetworkOffering implements Comparable<NetworkOffering> {
@Override
public String toString() {
return "[id=" + id + ", name=" + name + ", displayText=" + displayText + ", created=" + created
+ ", maxConnections=" + maxConnections + ", trafficType=" + trafficType + ", isDefault=" + isDefault
+ ", availability=" + availability + ", supportsVLAN=" + supportsVLAN + ", tags=" + getTags() + "]";
return "NetworkOffering{" +
"id=" + id +
", name='" + name + '\'' +
", displayText='" + displayText + '\'' +
", created=" + created +
", availability=" + availability +
", maxConnections=" + maxConnections +
", isDefault=" + isDefault +
", supportsVLAN=" + supportsVLAN +
", trafficType=" + trafficType +
", guestIPType=" + guestIPType +
", networkRate=" + networkRate +
", tags='" + tags + '\'' +
'}';
}
@Override

View File

@ -160,7 +160,10 @@ public class NetworkService implements Comparable<NetworkService> {
@Override
public String toString() {
return "[name=" + name + ", capabilities=" + capabilities + "]";
return "NetworkService{" +
"name='" + name + '\'' +
", capabilities=" + capabilities +
'}';
}
@Override

View File

@ -125,7 +125,11 @@ public class OSType implements Comparable<OSType> {
@Override
public String toString() {
return "[id=" + id + ", OSCategoryId=" + OSCategoryId + ", description=" + description + "]";
return "OSType{" +
"id=" + id +
", OSCategoryId=" + OSCategoryId +
", description='" + description + '\'' +
'}';
}
@Override

View File

@ -329,10 +329,21 @@ public class PortForwardingRule implements Comparable<PortForwardingRule> {
@Override
public String toString() {
return "[IPAddress=" + IPAddress + ", IPAddressId=" + IPAddressId + ", id=" + id + ", privatePort=" + privatePort
+ ", protocol=" + protocol + ", publicPort=" + publicPort + ", state=" + state
+ ", virtualMachineDisplayName=" + virtualMachineDisplayName + ", virtualMachineId=" + virtualMachineId
+ ", virtualMachineName=" + virtualMachineName + "]";
return "PortForwardingRule{" +
"id=" + id +
", IPAddress='" + IPAddress + '\'' +
", IPAddressId=" + IPAddressId +
", privatePort=" + privatePort +
", protocol='" + protocol + '\'' +
", publicPort=" + publicPort +
", state='" + state + '\'' +
", virtualMachineDisplayName='" + virtualMachineDisplayName + '\'' +
", virtualMachineId=" + virtualMachineId +
", virtualMachineName='" + virtualMachineName + '\'' +
", CIDRs=" + CIDRs +
", privateEndPort=" + privateEndPort +
", publicEndPort=" + publicEndPort +
'}';
}
}

View File

@ -18,10 +18,11 @@
*/
package org.jclouds.cloudstack.domain;
import static com.google.common.base.Preconditions.checkNotNull;
import javax.annotation.Nullable;
import java.util.Date;
import static com.google.common.base.Preconditions.checkNotNull;
import com.google.common.base.CaseFormat;
import com.google.gson.annotations.SerializedName;
@ -538,12 +539,29 @@ public class PublicIPAddress implements Comparable<PublicIPAddress> {
@Override
public String toString() {
return "[id=" + id + ", IPAddress=" + IPAddress + ", VLANId=" + VLANId + ", VLANName=" + VLANName + ", account="
+ account + ", allocated=" + allocated + ", associatedNetworkId=" + associatedNetworkId + ", domain="
+ domain + ", domainId=" + domainId + ", usesVirtualNetwork=" + usesVirtualNetwork + ", isSourceNAT="
+ isSourceNAT + ", isStaticNAT=" + isStaticNAT + ", networkId=" + networkId + ", state=" + state
+ ", virtualMachineDisplayName=" + virtualMachineDisplayName + ", virtualMachineId=" + virtualMachineId
+ ", virtualMachineName=" + virtualMachineName + ", zoneId=" + zoneId + ", zoneName=" + zoneName + "]";
return "PublicIPAddress{" +
"id=" + id +
", account='" + account + '\'' +
", allocated=" + allocated +
", associatedNetworkId=" + associatedNetworkId +
", domain='" + domain + '\'' +
", domainId=" + domainId +
", usesVirtualNetwork=" + usesVirtualNetwork +
", IPAddress='" + IPAddress + '\'' +
", isSourceNAT=" + isSourceNAT +
", isStaticNAT=" + isStaticNAT +
", networkId=" + networkId +
", state=" + state +
", virtualMachineDisplayName='" + virtualMachineDisplayName + '\'' +
", virtualMachineId=" + virtualMachineId +
", virtualMachineName='" + virtualMachineName + '\'' +
", VLANId=" + VLANId +
", VLANName='" + VLANName + '\'' +
", zoneId=" + zoneId +
", zoneName='" + zoneName + '\'' +
", jobId=" + jobId +
", jobStatus=" + jobStatus +
'}';
}
}

View File

@ -148,8 +148,13 @@ public class ResourceLimit implements Comparable<ResourceLimit> {
@Override
public String toString() {
return String.format("[account=%s, domain=%s, domainId=%d, max=%d, resourceType=%s]",
account, domain, domainId, max, resourceType);
return "ResourceLimit{" +
"account='" + account + '\'' +
", domain='" + domain + '\'' +
", domainId=" + domainId +
", max=" + max +
", resourceType=" + resourceType +
'}';
}
/**

View File

@ -240,8 +240,17 @@ public class SecurityGroup implements Comparable<SecurityGroup> {
@Override
public String toString() {
return "[id=" + id + ", account=" + account + ", name=" + name + ", description=" + description + ", domain="
+ domain + ", domainId=" + domainId + ", ingressRules=" + ingressRules + "]";
return "SecurityGroup{" +
"id=" + id +
", account='" + account + '\'' +
", name='" + name + '\'' +
", description='" + description + '\'' +
", domain='" + domain + '\'' +
", domainId=" + domainId +
", jobId=" + jobId +
", jobStatus=" + jobStatus +
", ingressRules=" + ingressRules +
'}';
}
@Override

View File

@ -411,10 +411,26 @@ public class ServiceOffering implements Comparable<ServiceOffering> {
@Override
public String toString() {
return "[id=" + id + ", name=" + name + ", displayText=" + displayText + ", created=" + created + ", cpuNumber="
+ cpuNumber + ", cpuSpeed=" + cpuSpeed + ", memory=" + memory + ", storageType=" + storageType
+ ", haSupport=" + haSupport + ", domain=" + domain + ", domainId=" + domainId + ", tags=" + getTags()
+ "]";
return "ServiceOffering{" +
"id=" + id +
", name='" + name + '\'' +
", displayText='" + displayText + '\'' +
", created=" + created +
", domain='" + domain + '\'' +
", domainId=" + domainId +
", cpuNumber=" + cpuNumber +
", cpuSpeed=" + cpuSpeed +
", memory=" + memory +
", haSupport=" + haSupport +
", storageType=" + storageType +
", tags='" + tags + '\'' +
", defaultUse=" + defaultUse +
", hostTags='" + hostTags + '\'' +
", systemOffering=" + systemOffering +
", cpuUseLimited=" + cpuUseLimited +
", networkRate=" + networkRate +
", systemVmType=" + systemVmType +
'}';
}
@Override

View File

@ -406,7 +406,7 @@ public class Snapshot implements Comparable<Snapshot> {
@Override
public String toString() {
return "Snapshot[" +
return "Snapshot{" +
"id=" + id +
", account='" + account + '\'' +
", created=" + created +
@ -420,8 +420,8 @@ public class Snapshot implements Comparable<Snapshot> {
", state=" + state +
", volumeId=" + volumeId +
", volumeName='" + volumeName + '\'' +
", volumeType='" + volumeType + '\'' +
']';
", volumeType=" + volumeType +
'}';
}
@Override

View File

@ -188,14 +188,14 @@ public class SnapshotPolicy implements Comparable<SnapshotPolicy> {
@Override
public String toString() {
return "[" +
"id=" + id +
", interval=" + interval +
", numberToRetain=" + numberToRetain +
", schedule='" + schedule + '\'' +
", timezone='" + timezone + '\'' +
", volumeId=" + volumeId +
']';
return "SnapshotPolicy{" +
"id=" + id +
", interval=" + interval +
", numberToRetain=" + numberToRetain +
", schedule='" + schedule + '\'' +
", timezone='" + timezone + '\'' +
", volumeId=" + volumeId +
'}';
}
@Override

View File

@ -41,4 +41,12 @@ public class SnapshotPolicySchedule {
public String getTime() {
return time;
}
@Override
public String toString() {
return "SnapshotPolicySchedule{" +
"interval=" + interval +
", time='" + time + '\'' +
'}';
}
}

View File

@ -125,7 +125,11 @@ public class SshKeyPair implements Comparable<SshKeyPair> {
@Override
public String toString() {
return "[fingerprint=" + fingerprint + ", name=" + name + "]";
return "SshKeyPair{" +
"fingerprint='" + fingerprint + '\'' +
", name='" + name + '\'' +
", privateKey='" + privateKey + '\'' +
'}';
}
@Override

View File

@ -737,13 +737,40 @@ public class Template implements Comparable<Template> {
@Override
public String toString() {
return "[id=" + id + ", name=" + name + ", displayText=" + displayText + ", format=" + format + ", type=" + type
+ ", hypervisor=" + hypervisor + ", size=" + size + ", status=" + status + ", created=" + created
+ ", removed=" + removed + ", OSType=" + OSType + ", OSTypeId=" + OSTypeId + ", account=" + account
+ ", accountId=" + accountId + ", domain=" + domain + ", domainId=" + domainId + ", zone=" + zone
+ ", zoneId=" + zoneId + ", ready=" + ready + ", bootable=" + bootable + ", crossZones=" + crossZones
+ ", extractable=" + extractable + ", featured=" + featured + ", ispublic=" + ispublic
+ ", passwordEnabled=" + passwordEnabled + ", jobId=" + jobId + ", jobStatus=" + jobStatus + "]";
return "Template{" +
"id=" + id +
", displayText='" + displayText + '\'' +
", domain='" + domain + '\'' +
", domainId=" + domainId +
", account='" + account + '\'' +
", accountId=" + accountId +
", zone='" + zone + '\'' +
", zoneId=" + zoneId +
", OSType='" + OSType + '\'' +
", OSTypeId=" + OSTypeId +
", name='" + name + '\'' +
", type=" + type +
", status='" + status + '\'' +
", format=" + format +
", hypervisor='" + hypervisor + '\'' +
", size=" + size +
", created=" + created +
", removed=" + removed +
", crossZones=" + crossZones +
", bootable=" + bootable +
", extractable=" + extractable +
", featured=" + featured +
", ispublic=" + ispublic +
", ready=" + ready +
", passwordEnabled=" + passwordEnabled +
", jobId=" + jobId +
", jobStatus='" + jobStatus + '\'' +
", checksum='" + checksum + '\'' +
", hostId=" + hostId +
", hostName='" + hostName + '\'' +
", sourceTemplateId=" + sourceTemplateId +
", templateTag='" + templateTag + '\'' +
'}';
}
@Override

View File

@ -332,11 +332,21 @@ public class TemplateExtraction implements Comparable<TemplateExtraction> {
@Override
public String toString() {
return "[id=" + id + ", accountId=" + accountId + ", created=" + created
+ ", extractId=" + extractId + ", extractMode=" + extractMode
+ ", name=" + name + ", state=" + state + ", status=" + status
+ ", storageType=" + storageType + ", uploadPercentage=" + uploadPercentage
+ ", url=" + url + ", zoneId=" + zoneId + ", zoneName=" + zoneName;
return "TemplateExtraction{" +
"id=" + id +
", accountId=" + accountId +
", created=" + created +
", extractId=" + extractId +
", extractMode=" + extractMode +
", name='" + name + '\'' +
", state='" + state + '\'' +
", status='" + status + '\'' +
", storageType='" + storageType + '\'' +
", uploadPercentage=" + uploadPercentage +
", url='" + url + '\'' +
", zoneId=" + zoneId +
", zoneName='" + zoneName + '\'' +
'}';
}
@Override

View File

@ -220,9 +220,17 @@ public class TemplateMetadata {
return Objects.hashCode(name, displayText, osTypeId, snapshotId, volumeId, passwordEnabled, virtualMachineId);
}
@Override
public String toString() {
return "[" + "name='" + name + '\'' + ", osTypeId=" + osTypeId + ", displayText='" + displayText + '\'' + ']';
}
@Override
public String toString() {
return "TemplateMetadata{" +
"name='" + name + '\'' +
", osTypeId=" + osTypeId +
", displayText='" + displayText + '\'' +
", snapshotId=" + snapshotId +
", volumeId=" + volumeId +
", virtualMachineId=" + virtualMachineId +
", passwordEnabled=" + passwordEnabled +
'}';
}
}

View File

@ -143,12 +143,12 @@ public class TemplatePermission implements Comparable<TemplatePermission> {
@Override
public String toString() {
return "[" +
"id=" + id +
", account='" + account + '\'' +
", domainId=" + domainId +
", isPublic=" + isPublic +
']';
return "TemplatePermission{" +
"id=" + id +
", account='" + account + '\'' +
", domainId=" + domainId +
", isPublic=" + isPublic +
'}';
}
@Override

View File

@ -326,11 +326,22 @@ public class User implements Comparable<User> {
@Override
public String toString() {
return String
.format(
"[id=%s, name=%s, state=%s, created=%s, account=%s, accountType=%s, domain=%s, domainId=%s, email=%s, firstName=%s, lastName=%s, apiKey=%s, secretKey=%s, timeZone=%s]",
id, name, state, created, account, accountType, domain, domainId, email, firstName, lastName, apiKey,
secretKey, timeZone);
return "User{" +
"id=" + id +
", name='" + name + '\'' +
", firstName='" + firstName + '\'' +
", lastName='" + lastName + '\'' +
", email='" + email + '\'' +
", created=" + created +
", state='" + state + '\'' +
", account='" + account + '\'' +
", accountType=" + accountType +
", domain='" + domain + '\'' +
", domainId=" + domainId +
", timeZone='" + timeZone + '\'' +
", apiKey='" + apiKey + '\'' +
", secretKey='" + secretKey + '\'' +
'}';
}
}

View File

@ -18,10 +18,10 @@
*/
package org.jclouds.cloudstack.domain;
import com.google.gson.annotations.SerializedName;
import java.util.Date;
import com.google.gson.annotations.SerializedName;
/**
* @author Richard Downer
*/
@ -170,13 +170,14 @@ public class VMGroup implements Comparable<VMGroup> {
@Override
public String toString() {
return "[id=" + id +
", account='" + account + '\'' +
", created=" + created +
", domain='" + domain + '\'' +
", domainId=" + domainId +
", name='" + name + '\'' +
'}';
return "VMGroup{" +
"id=" + id +
", account='" + account + '\'' +
", created=" + created +
", domain='" + domain + '\'' +
", domainId=" + domainId +
", name='" + name + '\'' +
'}';
}
@Override

View File

@ -958,23 +958,49 @@ public class VirtualMachine implements Comparable<VirtualMachine> {
@Override
public String toString() {
return "[id=" + id
// + ", account=" + account + ", cpuCount=" + cpuCount + ", cpuSpeed=" + cpuSpeed + ", cpuUsed=" + cpuUsed
+ ", displayName=" + displayName + ", created=" + created
// + ", domain=" + domain + ", domainId="
// + domainId + ", usesVirtualNetwork=" + usesVirtualNetwork + ", group=" + group + ", groupId=" + groupId
// + ", guestOSId=" + guestOSId + ", HAEnabled=" + HAEnabled + ", hostId=" + hostId + ", hostname=" + hostname
+ ", IPAddress=" + IPAddress
// + ", ISODisplayText=" + ISODisplayText + ", ISOId=" + ISOId + ", ISOName="
// + ISOName + ", jobId=" + jobId + ", jobStatus=" + jobStatus + ", memory=" + memory + ", name=" + name
// + ", networkKbsRead=" + networkKbsRead + ", networkKbsWrite=" + networkKbsWrite + ", password=" + password
// + ", passwordEnabled=" + passwordEnabled + ", rootDeviceId=" + rootDeviceId + ", rootDeviceType="
// + rootDeviceType + ", serviceOfferingId=" + serviceOfferingId + ", serviceOfferingName=" + serviceOfferingName
+ ", state=" + state
// + ", templateDisplayText=" + templateDisplayText
// + ", templateId=" + templateId + ", templateName=" + templateName + ", zoneId=" + zoneId + ", zoneName="
// + zoneName + ", nics=" + nics + ", hypervisor=" + hypervisor + ", securityGroups=" + securityGroups
+ "]";
return "VirtualMachine{" +
"id=" + id +
", account='" + account + '\'' +
", cpuCount=" + cpuCount +
", cpuSpeed=" + cpuSpeed +
", cpuUsed='" + cpuUsed + '\'' +
", displayName='" + displayName + '\'' +
", created=" + created +
", domain='" + domain + '\'' +
", domainId=" + domainId +
", usesVirtualNetwork=" + usesVirtualNetwork +
", group='" + group + '\'' +
", groupId=" + groupId +
", guestOSId=" + guestOSId +
", HAEnabled=" + HAEnabled +
", hostId=" + hostId +
", hostname='" + hostname + '\'' +
", IPAddress='" + IPAddress + '\'' +
", ISODisplayText='" + ISODisplayText + '\'' +
", ISOId=" + ISOId +
", ISOName='" + ISOName + '\'' +
", jobId=" + jobId +
", jobStatus=" + jobStatus +
", memory=" + memory +
", name='" + name + '\'' +
", networkKbsRead=" + networkKbsRead +
", networkKbsWrite=" + networkKbsWrite +
", password='" + password + '\'' +
", passwordEnabled=" + passwordEnabled +
", rootDeviceId=" + rootDeviceId +
", rootDeviceType='" + rootDeviceType + '\'' +
", serviceOfferingId=" + serviceOfferingId +
", serviceOfferingName='" + serviceOfferingName + '\'' +
", state=" + state +
", templateDisplayText='" + templateDisplayText + '\'' +
", templateId=" + templateId +
", templateName='" + templateName + '\'' +
", zoneId=" + zoneId +
", zoneName='" + zoneName + '\'' +
", nics=" + nics +
", hypervisor='" + hypervisor + '\'' +
", securityGroups=" + securityGroups +
'}';
}
@Override

View File

@ -19,10 +19,11 @@
package org.jclouds.cloudstack.domain;
import static com.google.common.base.Preconditions.checkNotNull;
import java.util.Date;
import java.util.Map;
import static com.google.common.base.Preconditions.checkNotNull;
import com.google.common.base.CaseFormat;
import com.google.common.base.Function;
import com.google.common.collect.ImmutableSet;
@ -551,7 +552,39 @@ public class Volume implements Comparable<Volume> {
@Override
public String toString() {
return getClass().getCanonicalName() + "[" + id + "; " + name + "; " + vmState + "]";
return "Volume{" +
"id=" + id +
", account='" + account + '\'' +
", attached=" + attached +
", created=" + created +
", destroyed=" + destroyed +
", deviceId=" + deviceId +
", diskOfferingDisplayText='" + diskOfferingDisplayText + '\'' +
", diskOfferingId=" + diskOfferingId +
", diskOfferingName='" + diskOfferingName + '\'' +
", domain='" + domain + '\'' +
", domainId=" + domainId +
", hypervisor='" + hypervisor + '\'' +
", isExtractable=" + isExtractable +
", jobId=" + jobId +
", jobStatus='" + jobStatus + '\'' +
", name='" + name + '\'' +
", serviceOfferingDisplayText='" + serviceOfferingDisplayText + '\'' +
", serviceOfferingId=" + serviceOfferingId +
", serviceOfferingName='" + serviceOfferingName + '\'' +
", size=" + size +
", snapshotId=" + snapshotId +
", state=" + state +
", storage='" + storage + '\'' +
", storageType='" + storageType + '\'' +
", type=" + type +
", virtualMachineId=" + virtualMachineId +
", vmDisplayName='" + vmDisplayName + '\'' +
", vmName='" + vmName + '\'' +
", vmState=" + vmState +
", zoneId=" + zoneId +
", zoneName='" + zoneName + '\'' +
'}';
}
public enum State {

View File

@ -413,10 +413,25 @@ public class Zone implements Comparable<Zone> {
@Override
public String toString() {
return "[id=" + id + ", allocationState=" + allocationState + ", name=" + name + ", description=" + description + ", displayText="
+ displayText + ", domain=" + domain + ", domainId=" + domainId + ", networkType=" + networkType
+ ", guestCIDRAddress=" + guestCIDRAddress + ", VLAN=" + VLAN + ", DNS=" + getDNS()
+ ", securityGroupsEnabled=" + isSecurityGroupsEnabled() + ", internalDNS=" + getInternalDNS() + "]";
return "Zone{" +
"id=" + id +
", description='" + description + '\'' +
", displayText='" + displayText + '\'' +
", DNS1='" + DNS1 + '\'' +
", DNS2='" + DNS2 + '\'' +
", domain='" + domain + '\'' +
", domainId=" + domainId +
", guestCIDRAddress='" + guestCIDRAddress + '\'' +
", internalDNS1='" + internalDNS1 + '\'' +
", internalDNS2='" + internalDNS2 + '\'' +
", name='" + name + '\'' +
", networkType=" + networkType +
", VLAN='" + VLAN + '\'' +
", securityGroupsEnabled=" + securityGroupsEnabled +
", allocationState='" + allocationState + '\'' +
", dhcpProvider='" + dhcpProvider + '\'' +
", zoneToken='" + zoneToken + '\'' +
'}';
}
@Override