1 package com.quantum.model;
6 public class Schema implements Comparable {
9 private String displayName;
10 private boolean isDefault;
16 public Schema(String name, String displayName, boolean isDefault) {
18 this.displayName = displayName;
19 this.isDefault = isDefault;
22 public Schema(String name) {
23 this(name, name, false);
29 public String getName() {
36 public void setName(String string) {
41 * @see java.lang.Comparable#compareTo(java.lang.Object)
43 public int compareTo(Object o) {
44 Schema that = (Schema) o;
45 if (that.isDefault() == this.isDefault()) {
46 return this.getDisplayName().compareTo(that.getDisplayName());
48 return that.isDefault() ? 1 : -1;
51 public boolean equals(Object obj) {
52 if (getClass() != obj.getClass()) {
55 Schema that = (Schema) obj;
56 if (this.name == null && !(that.name == null)) {
58 } else if (this.name != null && !this.name.equals(that.name)) {
60 } else if (this.displayName == null && !(that.displayName == null)) {
62 } else if (this.displayName == null && !this.displayName.equals(that.displayName)) {
69 public int hashCode() {
70 int hashCode = super.hashCode();
71 if (this.name != null) {
72 hashCode ^= this.name.hashCode();
74 if (this.displayName != null) {
75 hashCode ^= this.displayName.hashCode();
84 public boolean isDefault() {
91 public void setDefault(boolean isDefault) {
92 this.isDefault = isDefault;
98 public String getDisplayName() {
105 public void setDisplayName(String string) {
106 displayName = string;