01: /*
02: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
03: * Distributed under the terms of either:
04: * - the common development and distribution license (CDDL), v1.0; or
05: * - the GNU Lesser General Public License, v2.1 or later
06: * $Id: OrdrdRestrUnknown.java 3634 2007-01-08 21:42:24Z gbevin $
07: */
08: package com.uwyn.rife.cmf.dam;
09:
10: import com.uwyn.rife.site.ConstrainedBean;
11: import com.uwyn.rife.site.ConstrainedProperty;
12: import com.uwyn.rife.site.Validation;
13:
14: public class OrdrdRestrUnknown extends
15: Validation<ConstrainedBean, ConstrainedProperty> {
16: private int mId = -1;
17: private String mName = null;
18: private int mPriority = -1;
19: private int mRestricted = -1;
20:
21: public OrdrdRestrUnknown() {
22: mPriority = 0;
23: }
24:
25: protected void activateValidation() {
26: addConstraint(new ConstrainedProperty("name").maxLength(64)
27: .notNull(true).notEmpty(true));
28: addConstraint(new ConstrainedProperty("restricted")
29: .rangeBegin(0));
30: addConstraint(new ConstrainedProperty("priority").rangeBegin(0)
31: .ordinal(true, "restrictedunknown"));
32: }
33:
34: public void setId(int id) {
35: mId = id;
36: }
37:
38: public int getId() {
39: return mId;
40: }
41:
42: public void setPriority(int priority) {
43: mPriority = priority;
44: }
45:
46: public int getPriority() {
47: return mPriority;
48: }
49:
50: public OrdrdRestrUnknown priority(int priority) {
51: mPriority = priority;
52:
53: return this ;
54: }
55:
56: public void setName(String name) {
57: mName = name;
58: }
59:
60: public String getName() {
61: return mName;
62: }
63:
64: public OrdrdRestrUnknown name(String name) {
65: mName = name;
66:
67: return this ;
68: }
69:
70: public int getRestricted() {
71: return mRestricted;
72: }
73:
74: public void setRestricted(int restricted) {
75: mRestricted = restricted;
76: }
77:
78: public OrdrdRestrUnknown restricted(int restricted) {
79: setRestricted(restricted);
80:
81: return this;
82: }
83: }
|