| 1 |  |   | 
  | 2 |  |   | 
  | 3 |  |   | 
  | 4 |  |   | 
  | 5 |  |   | 
  | 6 |  |   | 
  | 7 |  |   | 
  | 8 |  |   | 
  | 9 |  |   | 
  | 10 |  |   | 
  | 11 |  |   | 
  | 12 |  |   | 
  | 13 |  |   | 
  | 14 |  |   | 
  | 15 |  |   | 
  | 16 |  |   | 
  | 17 |  |  package org.kuali.rice.kim.api.group; | 
  | 18 |  |   | 
  | 19 |  |  import org.apache.commons.lang.builder.EqualsBuilder; | 
  | 20 |  |  import org.apache.commons.lang.builder.HashCodeBuilder; | 
  | 21 |  |  import org.apache.commons.lang.builder.ToStringBuilder; | 
  | 22 |  |  import org.kuali.rice.core.api.CoreConstants; | 
  | 23 |  |  import org.kuali.rice.core.api.mo.ModelBuilder; | 
  | 24 |  |  import org.kuali.rice.core.api.mo.ModelObjectComplete; | 
  | 25 |  |  import org.w3c.dom.Element; | 
  | 26 |  |   | 
  | 27 |  |  import javax.xml.bind.annotation.XmlAccessType; | 
  | 28 |  |  import javax.xml.bind.annotation.XmlAccessorType; | 
  | 29 |  |  import javax.xml.bind.annotation.XmlAnyElement; | 
  | 30 |  |  import javax.xml.bind.annotation.XmlElement; | 
  | 31 |  |  import javax.xml.bind.annotation.XmlRootElement; | 
  | 32 |  |  import javax.xml.bind.annotation.XmlType; | 
  | 33 |  |  import java.io.Serializable; | 
  | 34 |  |  import java.util.Collection; | 
  | 35 |  |   | 
  | 36 |  |   | 
  | 37 |  |  @XmlRootElement(name = GroupAttribute.Constants.ROOT_ELEMENT_NAME) | 
  | 38 |  |  @XmlAccessorType(XmlAccessType.NONE) | 
  | 39 |  |  @XmlType(name = GroupAttribute.Constants.TYPE_NAME, propOrder = { | 
  | 40 |  |          GroupAttribute.Elements.ID, | 
  | 41 |  |          GroupAttribute.Elements.GROUP_ID, | 
  | 42 |  |          GroupAttribute.Elements.KIM_TYPE_ID, | 
  | 43 |  |          GroupAttribute.Elements.ATTRIBUTE_ID, | 
  | 44 |  |          GroupAttribute.Elements.VALUE, | 
  | 45 |  |          CoreConstants.CommonElements.VERSION_NUMBER, | 
  | 46 |  |          CoreConstants.CommonElements.OBJECT_ID, | 
  | 47 |  |          CoreConstants.CommonElements.FUTURE_ELEMENTS | 
  | 48 |  |  }) | 
  | 49 |  |  public class GroupAttribute implements GroupAttributeContract, ModelObjectComplete { | 
  | 50 |  |      @XmlElement(name = Elements.ID, required = true) | 
  | 51 |  |      private final String id; | 
  | 52 |  |   | 
  | 53 |  |      @XmlElement(name = Elements.GROUP_ID, required = false) | 
  | 54 |  |      private final String groupId; | 
  | 55 |  |   | 
  | 56 |  |      @XmlElement(name = Elements.KIM_TYPE_ID, required = true) | 
  | 57 |  |      private final String kimTypeId; | 
  | 58 |  |   | 
  | 59 |  |      @XmlElement(name = Elements.ATTRIBUTE_ID, required = false) | 
  | 60 |  |      private final String attributeId; | 
  | 61 |  |   | 
  | 62 |  |      @XmlElement(name = Elements.VALUE, required = false) | 
  | 63 |  |      private final String value; | 
  | 64 |  |   | 
  | 65 |  |      @XmlElement(name = CoreConstants.CommonElements.VERSION_NUMBER, required = false) | 
  | 66 |  |      private final Long versionNumber; | 
  | 67 |  |   | 
  | 68 |  |      @XmlElement(name = CoreConstants.CommonElements.OBJECT_ID, required = false) | 
  | 69 |  |      private final String objectId; | 
  | 70 |  |   | 
  | 71 | 14 |      @SuppressWarnings("unused") | 
  | 72 |  |      @XmlAnyElement | 
  | 73 |  |      private final Collection<Element> _futureElements = null; | 
  | 74 |  |   | 
  | 75 | 9 |      private GroupAttribute() { | 
  | 76 | 9 |          this.id = null; | 
  | 77 | 9 |          this.groupId = null; | 
  | 78 | 9 |          this.kimTypeId = null; | 
  | 79 | 9 |          this.attributeId = null; | 
  | 80 | 9 |          this.value = null; | 
  | 81 | 9 |          this.versionNumber = null; | 
  | 82 | 9 |          this.objectId = null; | 
  | 83 | 9 |      } | 
  | 84 |  |   | 
  | 85 | 5 |      public GroupAttribute(Builder builder) { | 
  | 86 | 5 |          this.id = builder.getId(); | 
  | 87 | 5 |          this.groupId = builder.getGroupId(); | 
  | 88 | 5 |          this.kimTypeId = builder.getKimTypeId(); | 
  | 89 | 5 |          this.attributeId = builder.getAttributeId(); | 
  | 90 | 5 |          this.value = builder.getValue(); | 
  | 91 | 5 |          this.versionNumber = builder.getVersionNumber(); | 
  | 92 | 5 |          this.objectId = builder.getObjectId(); | 
  | 93 | 5 |      } | 
  | 94 |  |   | 
  | 95 | 3 |      public static class Builder implements GroupAttributeContract, ModelBuilder, Serializable { | 
  | 96 |  |          private String id; | 
  | 97 |  |          private String groupId; | 
  | 98 |  |          private String kimTypeId; | 
  | 99 |  |          private String attributeId; | 
  | 100 |  |          private String value; | 
  | 101 |  |          private Long versionNumber; | 
  | 102 |  |          private String objectId; | 
  | 103 |  |   | 
  | 104 | 5 |          private Builder(String id, String kimTypeId) { | 
  | 105 | 5 |              setId(id); | 
  | 106 | 5 |              setKimTypeId(kimTypeId); | 
  | 107 | 5 |          } | 
  | 108 |  |   | 
  | 109 |  |           | 
  | 110 |  |   | 
  | 111 |  |   | 
  | 112 |  |          public static Builder create(String id, String kimTypeId) { | 
  | 113 | 0 |              return new Builder(id, kimTypeId); | 
  | 114 |  |          } | 
  | 115 |  |   | 
  | 116 |  |           | 
  | 117 |  |   | 
  | 118 |  |   | 
  | 119 |  |          public static Builder create(GroupAttributeContract contract) { | 
  | 120 | 5 |              Builder builder = new Builder(contract.getId(), contract.getKimTypeId()); | 
  | 121 | 5 |              builder.setGroupId(contract.getGroupId()); | 
  | 122 | 5 |              builder.setAttributeId(contract.getAttributeId()); | 
  | 123 | 5 |              builder.setValue(contract.getValue()); | 
  | 124 | 5 |              builder.setVersionNumber(contract.getVersionNumber()); | 
  | 125 | 5 |              builder.setObjectId(contract.getObjectId()); | 
  | 126 | 5 |              return builder; | 
  | 127 |  |          } | 
  | 128 |  |   | 
  | 129 |  |          @Override | 
  | 130 |  |          public String getId() { | 
  | 131 | 5 |              return id; | 
  | 132 |  |          } | 
  | 133 |  |   | 
  | 134 |  |          public void setId(final String id) { | 
  | 135 | 5 |              this.id = id; | 
  | 136 | 5 |          } | 
  | 137 |  |   | 
  | 138 |  |          @Override | 
  | 139 |  |          public String getGroupId() { | 
  | 140 | 5 |              return groupId; | 
  | 141 |  |          } | 
  | 142 |  |   | 
  | 143 |  |          public void setGroupId(final String groupId) { | 
  | 144 | 5 |              this.groupId = groupId; | 
  | 145 | 5 |          } | 
  | 146 |  |   | 
  | 147 |  |          @Override | 
  | 148 |  |          public String getKimTypeId() { | 
  | 149 | 5 |              return kimTypeId; | 
  | 150 |  |          } | 
  | 151 |  |   | 
  | 152 |  |          public void setKimTypeId(final String kimTypeId) { | 
  | 153 | 5 |              this.kimTypeId = kimTypeId; | 
  | 154 | 5 |          } | 
  | 155 |  |   | 
  | 156 |  |          @Override | 
  | 157 |  |          public String getAttributeId() { | 
  | 158 | 5 |              return attributeId; | 
  | 159 |  |          } | 
  | 160 |  |   | 
  | 161 |  |          public void setAttributeId(final String attributeId) { | 
  | 162 | 5 |              this.attributeId = attributeId; | 
  | 163 | 5 |          } | 
  | 164 |  |   | 
  | 165 |  |          @Override | 
  | 166 |  |          public String getValue() { | 
  | 167 | 5 |              return value; | 
  | 168 |  |          } | 
  | 169 |  |   | 
  | 170 |  |          public void setValue(final String value) { | 
  | 171 | 5 |              this.value = value; | 
  | 172 | 5 |          } | 
  | 173 |  |   | 
  | 174 |  |          @Override | 
  | 175 |  |          public Long getVersionNumber() { | 
  | 176 | 5 |              return versionNumber; | 
  | 177 |  |          } | 
  | 178 |  |   | 
  | 179 |  |          public void setVersionNumber(Long versionNumber) { | 
  | 180 | 5 |              this.versionNumber = versionNumber; | 
  | 181 | 5 |          } | 
  | 182 |  |   | 
  | 183 |  |          @Override | 
  | 184 |  |          public String getObjectId() { | 
  | 185 | 5 |              return objectId; | 
  | 186 |  |          } | 
  | 187 |  |   | 
  | 188 |  |          public void setObjectId(final String objectId) { | 
  | 189 | 5 |              this.objectId = objectId; | 
  | 190 | 5 |          } | 
  | 191 |  |   | 
  | 192 |  |          @Override | 
  | 193 |  |          public GroupAttribute build() { | 
  | 194 | 5 |              return new GroupAttribute(this); | 
  | 195 |  |          } | 
  | 196 |  |      } | 
  | 197 |  |   | 
  | 198 |  |      public String getId() { | 
  | 199 | 5 |          return id; | 
  | 200 |  |      } | 
  | 201 |  |   | 
  | 202 |  |      public String getGroupId() { | 
  | 203 | 5 |          return groupId; | 
  | 204 |  |      } | 
  | 205 |  |   | 
  | 206 |  |      public String getKimTypeId() { | 
  | 207 | 5 |          return kimTypeId; | 
  | 208 |  |      } | 
  | 209 |  |   | 
  | 210 |  |      public String getAttributeId() { | 
  | 211 | 5 |          return attributeId; | 
  | 212 |  |      } | 
  | 213 |  |   | 
  | 214 |  |      public String getValue() { | 
  | 215 | 5 |          return value; | 
  | 216 |  |      } | 
  | 217 |  |   | 
  | 218 |  |      public Long getVersionNumber() { | 
  | 219 | 5 |          return versionNumber; | 
  | 220 |  |      } | 
  | 221 |  |   | 
  | 222 |  |      public String getObjectId() { | 
  | 223 | 5 |          return objectId; | 
  | 224 |  |      } | 
  | 225 |  |   | 
  | 226 |  |      @Override | 
  | 227 |  |      public int hashCode() { | 
  | 228 | 0 |          return HashCodeBuilder.reflectionHashCode(this, Constants.HASH_CODE_EQUALS_EXCLUDE); | 
  | 229 |  |      } | 
  | 230 |  |   | 
  | 231 |  |      @Override | 
  | 232 |  |      public boolean equals(Object obj) { | 
  | 233 | 3 |          return EqualsBuilder.reflectionEquals(obj, this, Constants.HASH_CODE_EQUALS_EXCLUDE); | 
  | 234 |  |      } | 
  | 235 |  |   | 
  | 236 |  |      @Override | 
  | 237 |  |      public String toString() { | 
  | 238 | 0 |          return ToStringBuilder.reflectionToString(this); | 
  | 239 |  |      } | 
  | 240 |  |   | 
  | 241 |  |       | 
  | 242 |  |   | 
  | 243 |  |   | 
  | 244 | 0 |      static class Constants { | 
  | 245 |  |          final static String ROOT_ELEMENT_NAME = "groupAttribute"; | 
  | 246 |  |          final static String TYPE_NAME = "GroupAttributeType"; | 
  | 247 | 1 |          final static String[] HASH_CODE_EQUALS_EXCLUDE = {CoreConstants.CommonElements.FUTURE_ELEMENTS}; | 
  | 248 |  |      } | 
  | 249 |  |   | 
  | 250 |  |       | 
  | 251 |  |   | 
  | 252 |  |   | 
  | 253 |  |   | 
  | 254 | 0 |      static class Elements { | 
  | 255 |  |          final static String ID = "id"; | 
  | 256 |  |          final static String GROUP_ID = "groupId"; | 
  | 257 |  |          final static String KIM_TYPE_ID = "kimTypeId"; | 
  | 258 |  |          final static String ATTRIBUTE_ID = "attributeId"; | 
  | 259 |  |          final static String VALUE = "value"; | 
  | 260 |  |      } | 
  | 261 |  |  } |