1 42 43 package org.jfree.xml.generator.model; 44 45 48 public class TypeInfo { 49 50 51 private String name; 52 53 54 private Class type; 55 56 57 private boolean nullable; 58 59 60 private boolean constrained; 61 62 63 private String description; 64 65 66 private Comments comments; 67 68 74 public TypeInfo(final String name, final Class type) { 75 if (name == null) { 76 throw new NullPointerException ("Name"); 77 } 78 this.name = name; 79 this.type = type; 80 } 81 82 87 public Class getType() { 88 return this.type; 89 } 90 91 96 public boolean isNullable() { 97 return this.nullable; 98 } 99 100 105 public void setNullable(final boolean nullable) { 106 this.nullable = nullable; 107 } 108 109 114 public boolean isConstrained() { 115 return this.constrained; 116 } 117 118 123 public void setConstrained(final boolean constrained) { 124 this.constrained = constrained; 125 } 126 127 132 public String getDescription() { 133 return this.description; 134 } 135 136 141 public void setDescription(final String description) { 142 this.description = description; 143 } 144 145 150 public String getName() { 151 return this.name; 152 } 153 154 159 public Comments getComments() { 160 return this.comments; 161 } 162 163 168 public void setComments(final Comments comments) { 169 this.comments = comments; 170 } 171 178 public boolean equals(final Object o) { 179 if (this == o) { 180 return true; 181 } 182 if (!(o instanceof TypeInfo)) { 183 return false; 184 } 185 186 final TypeInfo typeInfo = (TypeInfo) o; 187 188 if (!this.name.equals(typeInfo.name)) { 189 return false; 190 } 191 if (!this.type.equals(typeInfo.type)) { 192 return false; 193 } 194 195 return true; 196 } 197 198 203 public int hashCode() { 204 int result; 205 result = this.name.hashCode(); 206 result = 29 * result + this.type.hashCode(); 207 result = 29 * result + (this.nullable ? 1 : 0); 208 result = 29 * result + (this.constrained ? 1 : 0); 209 result = 29 * result + (this.description != null ? this.description.hashCode() : 0); 210 return result; 211 } 212 213 } 214 | Popular Tags |