Issue 191: hid incidental constructors

This commit is contained in:
Adrian Cole 2010-07-07 10:05:44 -07:00
parent a47a369d18
commit c948e49183
6 changed files with 18 additions and 21 deletions

View File

@ -47,7 +47,6 @@ public class CookbookVersion {
@SerializedName("root_files") @SerializedName("root_files")
private Set<Resource> rootFiles = Sets.newLinkedHashSet(); private Set<Resource> rootFiles = Sets.newLinkedHashSet();
// internal // internal
@SuppressWarnings("unused") @SuppressWarnings("unused")
@SerializedName("json_class") @SerializedName("json_class")
@ -81,7 +80,8 @@ public class CookbookVersion {
Iterables.addAll(this.rootFiles, rootFiles); Iterables.addAll(this.rootFiles, rootFiles);
} }
public CookbookVersion() { // hidden but needs to be here for json deserialization to work
CookbookVersion() {
} }

View File

@ -34,11 +34,12 @@ public class Organization implements Comparable<Organization> {
private String clientname; private String clientname;
public Organization(String name) { public Organization(String name) {
super(); this();
this.name = name; this.name = name;
} }
public Organization() { // hidden but needs to be here for json deserialization to work
Organization() {
super(); super();
} }

View File

@ -45,7 +45,8 @@ public class Resource {
this.specificity = specificity; this.specificity = specificity;
} }
public Resource() { // hidden but needs to be here for json deserialization to work
Resource() {
} }
public String getName() { public String getName() {

View File

@ -42,7 +42,8 @@ public class User implements Comparable<User> {
this.username = username; this.username = username;
} }
public User() { // hidden but needs to be here for json deserialization to work
User() {
super(); super();
} }
@ -111,14 +112,11 @@ public class User implements Comparable<User> {
public int hashCode() { public int hashCode() {
final int prime = 31; final int prime = 31;
int result = 1; int result = 1;
result = prime * result result = prime * result + ((displayName == null) ? 0 : displayName.hashCode());
+ ((displayName == null) ? 0 : displayName.hashCode());
result = prime * result + ((email == null) ? 0 : email.hashCode()); result = prime * result + ((email == null) ? 0 : email.hashCode());
result = prime * result result = prime * result + ((firstName == null) ? 0 : firstName.hashCode());
+ ((firstName == null) ? 0 : firstName.hashCode());
result = prime * result + ((lastName == null) ? 0 : lastName.hashCode()); result = prime * result + ((lastName == null) ? 0 : lastName.hashCode());
result = prime * result result = prime * result + ((middleName == null) ? 0 : middleName.hashCode());
+ ((middleName == null) ? 0 : middleName.hashCode());
result = prime * result + ((password == null) ? 0 : password.hashCode()); result = prime * result + ((password == null) ? 0 : password.hashCode());
result = prime * result + ((username == null) ? 0 : username.hashCode()); result = prime * result + ((username == null) ? 0 : username.hashCode());
return result; return result;
@ -173,9 +171,8 @@ public class User implements Comparable<User> {
@Override @Override
public String toString() { public String toString() {
return "User [displayName=" + displayName + ", email=" + email return "User [displayName=" + displayName + ", email=" + email + ", firstName=" + firstName
+ ", firstName=" + firstName + ", lastName=" + lastName + ", lastName=" + lastName + ", middleName=" + middleName + ", password=" + password
+ ", middleName=" + middleName + ", password=" + password
+ ", username=" + username + "]"; + ", username=" + username + "]";
} }

View File

@ -50,8 +50,7 @@ public class ParseOrganizationFromJsonTest {
public void test() { public void test() {
Organization org = new Organization(); Organization org = new Organization("opscode");
org.setName("opscode");
org.setFullName("Opscode, Inc."); org.setFullName("Opscode, Inc.");
org.setOrgType("Business"); org.setOrgType("Business");
org.setClientname("opscode-validator"); org.setClientname("opscode-validator");

View File

@ -32,8 +32,7 @@ public class ParseUserFromJsonTest {
public void test() { public void test() {
User user = new User(); User user = new User("bobo");
user.setUsername("bobo");
user.setFirstName("Bobo"); user.setFirstName("Bobo");
user.setMiddleName("Tiberion"); user.setMiddleName("Tiberion");
user.setLastName("Clown"); user.setLastName("Clown");