1 23 24 package org.infoglue.cms.util.validators; 25 26 36 public class ConstraintRule 37 { 38 private int constraintType; 40 private String fieldName; 41 private Object value = null; 42 private Range validRange = new Range(); 43 44 45 public boolean unique = false; 47 public boolean required = false; 48 49 public ConstraintRule(int constraintType, String fieldName) 51 { 52 this.constraintType = constraintType; 53 this.fieldName = fieldName; 54 } 55 56 58 public int getConstraintType() 59 { 60 return constraintType; 61 } 62 public String getFieldName() 63 { 64 return fieldName; 65 } 66 67 public Object getValue() 68 { 69 return value; 70 } 71 72 public void setValue(Object value) 73 { 74 this.value = value; 75 } 76 77 public Range getValidRange() 78 { 79 return validRange; 80 } 81 82 public void setValidRange(Range validRange) 83 { 84 this.validRange = validRange; 85 } 86 87 91 public boolean isRequired() 92 { 93 return required; 94 } 95 96 100 public boolean isUnique() 101 { 102 return unique; 103 } 104 105 109 public void setRequired(boolean required) 110 { 111 this.required = required; 112 } 113 114 118 public void setUnique(boolean unique) 119 { 120 this.unique = unique; 121 } 122 123 } 124 | Popular Tags |