Coverage Report - org.kuali.student.datadictionary.dto.AttributeDefinitionInfo
 
Classes in this File Line Coverage Branch Coverage Complexity
AttributeDefinitionInfo
67%
45/67
100%
2/2
1.015
AttributeDefinitionInfo$1
N/A
N/A
1.015
AttributeDefinitionInfo$Builder
95%
81/85
N/A
1.015
 
 1  
 /*
 2  
  * Copyright 2011 The Kuali Foundation
 3  
  *
 4  
  * Licensed under the Educational Community License, Version 1.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  *
 8  
  * http://www.opensource.org/licenses/ecl1.php
 9  
  *
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13  
  * See the License for the specific language governing permissions and
 14  
  * limitations under the License.
 15  
  */
 16  
 package org.kuali.student.datadictionary.dto;
 17  
 
 18  
 import java.io.Serializable;
 19  
 import javax.xml.bind.annotation.XmlAccessType;
 20  
 import javax.xml.bind.annotation.XmlAccessorType;
 21  
 import javax.xml.bind.annotation.XmlElement;
 22  
 import org.kuali.rice.kns.datadictionary.validation.DataType;
 23  
 import org.kuali.student.datadictionary.infc.AttributeDefinitionInfc;
 24  
 import org.kuali.student.datadictionary.infc.ValidCharactersConstraintInfc;
 25  
 
 26  255
 @XmlAccessorType(XmlAccessType.FIELD)
 27  510
 public class AttributeDefinitionInfo implements AttributeDefinitionInfc, Serializable {
 28  
 
 29  
     private static final long serialVersionUID = 1L;
 30  
     @XmlElement
 31  
     private String name;
 32  
     @XmlElement
 33  
     private String childEntryName;
 34  
     @XmlElement
 35  
     private DataType dataType;
 36  
     @XmlElement
 37  
     private Boolean required;
 38  
     @XmlElement
 39  
     private Integer minOccurs;
 40  
     @XmlElement
 41  
     private Integer maxOccurs;
 42  
     @XmlElement
 43  
     private Integer minLength;
 44  
     @XmlElement
 45  
     private Integer maxLength;
 46  
     @XmlElement
 47  
     private Boolean forceUppercase;
 48  
     @XmlElement
 49  
     private String shortLabel;
 50  
     @XmlElement
 51  
     private String summary;
 52  
     @XmlElement
 53  
     private String label;
 54  
     @XmlElement
 55  
     private String description;
 56  
     @XmlElement
 57  
     private String exclusiveMin;
 58  
     @XmlElement
 59  
     private String inclusiveMax;
 60  
     @XmlElement
 61  
     private String displayLabelAttribute;
 62  
     @XmlElement
 63  
     private Boolean unique;
 64  
     @XmlElement
 65  
     private String customValidatorClass;
 66  
     @XmlElement
 67  
     private String formatterClass;
 68  
     @XmlElement
 69  
     private ValidCharactersConstraintInfo validCharactersConstraint;
 70  
 
 71  0
     public AttributeDefinitionInfo() {
 72  0
         this.name = null;
 73  0
         this.childEntryName = null;
 74  0
         this.dataType = null;
 75  0
         this.required = null;
 76  0
         this.minOccurs = null;
 77  0
         this.maxOccurs = null;
 78  0
         this.minLength = null;
 79  0
         this.maxLength = null;
 80  0
         this.forceUppercase = null;
 81  0
         this.shortLabel = null;
 82  0
         this.summary = null;
 83  0
         this.label = null;
 84  0
         this.description = null;
 85  0
         this.exclusiveMin = null;
 86  0
         this.inclusiveMax = null;
 87  0
         this.displayLabelAttribute = null;
 88  0
         this.unique = null;
 89  0
         this.customValidatorClass = null;
 90  0
         this.formatterClass = null;
 91  0
         this.validCharactersConstraint = null;
 92  
 
 93  0
     }
 94  
 
 95  
     @Override
 96  
     public String getName() {
 97  255
         return this.name;
 98  
     }
 99  
 
 100  
     @Override
 101  
     public String getChildEntryName() {
 102  255
         return this.childEntryName;
 103  
     }
 104  
 
 105  
     @Override
 106  
     public DataType getDataType() {
 107  255
         return this.dataType;
 108  
     }
 109  
 
 110  
     @Override
 111  
     public Boolean isRequired() {
 112  255
         return this.required;
 113  
     }
 114  
 
 115  
     @Override
 116  
     public Integer getMinOccurs() {
 117  255
         return this.minOccurs;
 118  
     }
 119  
 
 120  
     @Override
 121  
     public Integer getMaxOccurs() {
 122  255
         return this.maxOccurs;
 123  
     }
 124  
 
 125  
     @Override
 126  
     public Integer getMinLength() {
 127  255
         return this.minLength;
 128  
     }
 129  
 
 130  
     @Override
 131  
     public Integer getMaxLength() {
 132  255
         return this.maxLength;
 133  
     }
 134  
 
 135  
     @Override
 136  
     public Boolean getForceUppercase() {
 137  255
         return this.forceUppercase;
 138  
     }
 139  
 
 140  
     @Override
 141  
     public String getShortLabel() {
 142  255
         return this.shortLabel;
 143  
     }
 144  
 
 145  
     @Override
 146  
     public String getSummary() {
 147  255
         return this.summary;
 148  
     }
 149  
 
 150  
     @Override
 151  
     public String getLabel() {
 152  255
         return this.label;
 153  
     }
 154  
 
 155  
     @Override
 156  
     public String getDescription() {
 157  255
         return this.description;
 158  
     }
 159  
 
 160  
     @Override
 161  
     public String getExclusiveMin() {
 162  255
         return this.exclusiveMin;
 163  
     }
 164  
 
 165  
     @Override
 166  
     public String getInclusiveMax() {
 167  255
         return this.inclusiveMax;
 168  
     }
 169  
 
 170  
     @Override
 171  
     public String getDisplayLabelAttribute() {
 172  255
         return this.displayLabelAttribute;
 173  
     }
 174  
 
 175  
     @Override
 176  
     public Boolean isUnique() {
 177  255
         return this.unique;
 178  
     }
 179  
 
 180  
     @Override
 181  
     public String getCustomValidatorClass() {
 182  255
         return this.customValidatorClass;
 183  
     }
 184  
 
 185  
     @Override
 186  
     public String getFormatterClass() {
 187  255
         return this.formatterClass;
 188  
     }
 189  
 
 190  
     @Override
 191  
     public ValidCharactersConstraintInfo getValidCharactersConstraint() {
 192  255
         return this.validCharactersConstraint;
 193  
     }
 194  
 
 195  510
     private AttributeDefinitionInfo(AttributeDefinitionInfc infc) {
 196  510
         this.name = infc.getName();
 197  510
         this.childEntryName = infc.getChildEntryName();
 198  510
         this.dataType = infc.getDataType();
 199  510
         this.required = infc.isRequired();
 200  510
         this.minOccurs = infc.getMinOccurs();
 201  510
         this.maxOccurs = infc.getMaxOccurs();
 202  510
         this.minLength = infc.getMinLength();
 203  510
         this.maxLength = infc.getMaxLength();
 204  510
         this.forceUppercase = infc.getForceUppercase();
 205  510
         this.shortLabel = infc.getShortLabel();
 206  510
         this.summary = infc.getSummary();
 207  510
         this.label = infc.getLabel();
 208  510
         this.description = infc.getDescription();
 209  510
         this.exclusiveMin = infc.getExclusiveMin();
 210  510
         this.inclusiveMax = infc.getInclusiveMax();
 211  510
         this.displayLabelAttribute = infc.getDisplayLabelAttribute();
 212  510
         this.unique = infc.isUnique();
 213  510
         this.customValidatorClass = infc.getCustomValidatorClass();
 214  510
         this.formatterClass = infc.getFormatterClass();
 215  510
         if (infc.getValidCharactersConstraint() != null) {
 216  310
             this.validCharactersConstraint = new ValidCharactersConstraintInfo.Builder(infc.getValidCharactersConstraint()).build();
 217  
         }
 218  510
     }
 219  
 
 220  
     public static class Builder implements AttributeDefinitionInfc {
 221  
 
 222  
         private String name;
 223  
         private String childEntryName;
 224  
         private DataType dataType;
 225  
         private Boolean required;
 226  
         private Integer minOccurs;
 227  
         private Integer maxOccurs;
 228  
         private Integer minLength;
 229  
         private Integer maxLength;
 230  
         private Boolean forceUppercase;
 231  
         private String shortLabel;
 232  
         private String summary;
 233  
         private String label;
 234  
         private String description;
 235  
         private String exclusiveMin;
 236  
         private String inclusiveMax;
 237  
         private String displayLabelAttribute;
 238  
         private Boolean unique;
 239  
         private String customValidatorClass;
 240  
         private String formatterClass;
 241  
         private ValidCharactersConstraintInfc validCharactersConstraint;
 242  
 
 243  255
         public Builder() {
 244  255
         }
 245  
 
 246  255
         public Builder(AttributeDefinitionInfc infc) {
 247  255
             this.name = infc.getName();
 248  255
             this.childEntryName = infc.getChildEntryName();
 249  255
             this.dataType = infc.getDataType();
 250  255
             this.required = infc.isRequired();
 251  255
             this.minOccurs = infc.getMinOccurs();
 252  255
             this.maxOccurs = infc.getMaxOccurs();
 253  255
             this.minLength = infc.getMinLength();
 254  255
             this.maxLength = infc.getMaxLength();
 255  255
             this.forceUppercase = infc.getForceUppercase();
 256  255
             this.shortLabel = infc.getShortLabel();
 257  255
             this.summary = infc.getSummary();
 258  255
             this.label = infc.getLabel();
 259  255
             this.description = infc.getDescription();
 260  255
             this.exclusiveMin = infc.getExclusiveMin();
 261  255
             this.inclusiveMax = infc.getInclusiveMax();
 262  255
             this.displayLabelAttribute = infc.getDisplayLabelAttribute();
 263  255
             this.unique = infc.isUnique();
 264  255
             this.customValidatorClass = infc.getCustomValidatorClass();
 265  255
             this.formatterClass = infc.getFormatterClass();
 266  255
             this.validCharactersConstraint = infc.getValidCharactersConstraint();
 267  255
         }
 268  
 
 269  
         public AttributeDefinitionInfo build() {
 270  510
             return new AttributeDefinitionInfo(this);
 271  
         }
 272  
 
 273  
         @Override
 274  
         public String getChildEntryName() {
 275  510
             return this.childEntryName;
 276  
         }
 277  
 
 278  
         @Override
 279  
         public String getCustomValidatorClass() {
 280  510
             return this.customValidatorClass;
 281  
         }
 282  
 
 283  
         @Override
 284  
         public DataType getDataType() {
 285  510
             return this.dataType;
 286  
         }
 287  
 
 288  
         @Override
 289  
         public String getDescription() {
 290  510
             return this.description;
 291  
         }
 292  
 
 293  
         @Override
 294  
         public String getDisplayLabelAttribute() {
 295  510
             return this.displayLabelAttribute;
 296  
         }
 297  
 
 298  
         @Override
 299  
         public String getExclusiveMin() {
 300  510
             return this.exclusiveMin;
 301  
         }
 302  
 
 303  
         @Override
 304  
         public Boolean getForceUppercase() {
 305  510
             return this.forceUppercase;
 306  
         }
 307  
 
 308  
         @Override
 309  
         public String getFormatterClass() {
 310  510
             return this.formatterClass;
 311  
         }
 312  
 
 313  
         @Override
 314  
         public String getInclusiveMax() {
 315  510
             return this.inclusiveMax;
 316  
         }
 317  
 
 318  
         @Override
 319  
         public String getLabel() {
 320  510
             return this.label;
 321  
         }
 322  
 
 323  
         @Override
 324  
         public Integer getMaxLength() {
 325  510
             return this.maxLength;
 326  
         }
 327  
 
 328  
         @Override
 329  
         public Integer getMaxOccurs() {
 330  510
             return this.maxOccurs;
 331  
         }
 332  
 
 333  
         @Override
 334  
         public Integer getMinLength() {
 335  510
             return this.minLength;
 336  
         }
 337  
 
 338  
         @Override
 339  
         public Integer getMinOccurs() {
 340  510
             return this.minOccurs;
 341  
         }
 342  
 
 343  
         @Override
 344  
         public String getName() {
 345  510
             return this.name;
 346  
         }
 347  
 
 348  
         @Override
 349  
         public String getShortLabel() {
 350  510
             return this.shortLabel;
 351  
         }
 352  
 
 353  
         @Override
 354  
         public String getSummary() {
 355  510
             return this.summary;
 356  
         }
 357  
 
 358  
         @Override
 359  
         public Boolean isUnique() {
 360  510
             return this.unique;
 361  
         }
 362  
 
 363  
         @Override
 364  
         public ValidCharactersConstraintInfc getValidCharactersConstraint() {
 365  820
             return this.validCharactersConstraint;
 366  
         }
 367  
 
 368  
         @Override
 369  
         public Boolean isRequired() {
 370  510
             return this.required;
 371  
         }
 372  
 
 373  
         public Builder setChildEntryName(String childEntryName) {
 374  255
             this.childEntryName = childEntryName;
 375  255
             return this;
 376  
         }
 377  
 
 378  
         public Builder setCustomValidatorClass(String customValidatorClass) {
 379  255
             this.customValidatorClass = customValidatorClass;
 380  255
             return this;
 381  
         }
 382  
 
 383  
         public Builder setDataType(DataType dataType) {
 384  255
             this.dataType = dataType;
 385  255
             return this;
 386  
         }
 387  
 
 388  
         public Builder setDescription(String description) {
 389  255
             this.description = description;
 390  255
             return this;
 391  
         }
 392  
 
 393  
         public Builder setDisplayLabelAttribute(String displayLabelAttribute) {
 394  255
             this.displayLabelAttribute = displayLabelAttribute;
 395  255
             return this;
 396  
         }
 397  
 
 398  
         public Builder setExclusiveMin(String exclusiveMin) {
 399  255
             this.exclusiveMin = exclusiveMin;
 400  255
             return this;
 401  
         }
 402  
 
 403  
         public Builder setForceUppercase(Boolean forceUppercase) {
 404  255
             this.forceUppercase = forceUppercase;
 405  255
             return this;
 406  
         }
 407  
 
 408  
         public Builder setFormatterClass(String formatterClass) {
 409  255
             this.formatterClass = formatterClass;
 410  255
             return this;
 411  
         }
 412  
 
 413  
         public Builder setInclusiveMax(String inclusiveMax) {
 414  255
             this.inclusiveMax = inclusiveMax;
 415  255
             return this;
 416  
         }
 417  
 
 418  
         public Builder setLabel(String label) {
 419  255
             this.label = label;
 420  255
             return this;
 421  
         }
 422  
 
 423  
         public Builder setMaxLength(Integer maxLength) {
 424  255
             this.maxLength = maxLength;
 425  255
             return this;
 426  
         }
 427  
 
 428  
         public Builder setMaxOccurs(Integer maxOccurs) {
 429  0
             this.maxOccurs = maxOccurs;
 430  0
             return this;
 431  
         }
 432  
 
 433  
         public Builder setMinLength(Integer minLength) {
 434  255
             this.minLength = minLength;
 435  255
             return this;
 436  
         }
 437  
 
 438  
         public Builder setMinOccurs(Integer minOccurs) {
 439  0
             this.minOccurs = minOccurs;
 440  0
             return this;
 441  
         }
 442  
 
 443  
         public Builder setName(String name) {
 444  255
             this.name = name;
 445  255
             return this;
 446  
         }
 447  
 
 448  
         public Builder setRequired(Boolean required) {
 449  255
             this.required = required;
 450  255
             return this;
 451  
         }
 452  
 
 453  
         public Builder setShortLabel(String shortLabel) {
 454  255
             this.shortLabel = shortLabel;
 455  255
             return this;
 456  
         }
 457  
 
 458  
         public Builder setSummary(String summary) {
 459  255
             this.summary = summary;
 460  255
             return this;
 461  
         }
 462  
 
 463  
         public Builder setUnique(Boolean unique) {
 464  255
             this.unique = unique;
 465  255
             return this;
 466  
         }
 467  
 
 468  
         public Builder setValidCharactersConstraint(ValidCharactersConstraintInfc validCharactersConstraint) {
 469  155
             this.validCharactersConstraint = validCharactersConstraint;
 470  155
             return this;
 471  
         }
 472  
     }
 473  
 }