Added IsEnabled property to Org

This commit is contained in:
Andrew Donald Kennedy 2012-02-09 13:25:15 +00:00
parent fbe68686d3
commit d983eb3826
1 changed files with 44 additions and 6 deletions

View File

@ -63,6 +63,7 @@ public class Org extends EntityType<Org> {
public static class Builder extends EntityType.Builder<Org> { public static class Builder extends EntityType.Builder<Org> {
private String fullName; private String fullName;
private Boolean isEnabled;
/** /**
* @see Org#getFullName() * @see Org#getFullName()
@ -72,6 +73,30 @@ public class Org extends EntityType<Org> {
return this; return this;
} }
/**
* @see Org#isEnabled()
*/
public Builder isEnabled(Boolean isEnabled) {
this.isEnabled = isEnabled;
return this;
}
/**
* @see Org#isEnabled()
*/
public Builder enabled() {
this.isEnabled = Boolean.TRUE;
return this;
}
/**
* @see Org#isEnabled()
*/
public Builder disabled() {
this.isEnabled = Boolean.FALSE;
return this;
}
@Override @Override
public Org build() { public Org build() {
Org org = new Org(href, name, fullName); Org org = new Org(href, name, fullName);
@ -80,6 +105,7 @@ public class Org extends EntityType<Org> {
org.setType(type); org.setType(type);
org.setLinks(links); org.setLinks(links);
org.setTasksInProgress(tasksInProgress); org.setTasksInProgress(tasksInProgress);
org.setIsEnabled(isEnabled);
return org; return org;
} }
@ -174,17 +200,29 @@ public class Org extends EntityType<Org> {
this.fullName = fullName; this.fullName = fullName;
} }
@XmlElement(namespace = VCLOUD_1_5_NS, name = "FullName") @XmlElement(namespace = VCLOUD_1_5_NS, name = "FullName", required = true)
private String fullName; private String fullName;
@XmlElement(namespace = VCLOUD_1_5_NS, name = "IsEnabled")
private Boolean isEnabled;
/** /**
* * Full name of the organization.
* @return fullName of the org
*/ */
public String getFullName() { public String getFullName() {
return fullName; return fullName;
} }
/**
* Full name of the organization.
*/
public Boolean isEnabled() {
return isEnabled;
}
public void isEnabled(Boolean isEnabled) {
this.isEnabled = isEnabled;
}
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) if (this == o)
@ -192,16 +230,16 @@ public class Org extends EntityType<Org> {
if (o == null || getClass() != o.getClass()) if (o == null || getClass() != o.getClass())
return false; return false;
Org that = Org.class.cast(o); Org that = Org.class.cast(o);
return super.equals(that) && equal(fullName, that.fullName); return super.equals(that) && equal(fullName, that.fullName) && equal(this.isEnabled, that.isEnabled);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return super.hashCode() + Objects.hashCode(fullName); return super.hashCode() + Objects.hashCode(fullName, isEnabled);
} }
@Override @Override
public ToStringHelper string() { public ToStringHelper string() {
return super.string().add("fullName", fullName); return super.string().add("fullName", fullName).add("isEnabled", isEnabled);
} }
} }