1 // =================== DO NOT EDIT THIS FILE ====================
2 // Generated by Modello 1.7,
3 // any modifications will be overwritten.
4 // ==============================================================
5
6 package org.apache.archiva.redback.rbac.jdo;
7
8 /**
9 *
10 * In RBAC terms, this is the entity which an operation is
11 * associated with that which permissions are based on.
12 *
13 *
14 * @version $Revision$ $Date$
15 */
16 public class JdoResource
17 implements org.apache.archiva.redback.rbac.Resource, java.io.Serializable
18 {
19
20 //--------------------------/
21 //- Class/Member Variables -/
22 //--------------------------/
23
24 /**
25 *
26 * The string identifier for a resource.
27 *
28 */
29 private String identifier;
30
31 /**
32 *
33 * true if the identifer is a pattern that is to be
34 * evaluated, for example x.* could match x.a or x.b and x.**
35 * could match x.foo
36 * .
37 */
38 private boolean pattern = false;
39
40 /**
41 *
42 * true if this object is permanent.
43 *
44 */
45 private boolean permanent = false;
46
47
48 //-----------/
49 //- Methods -/
50 //-----------/
51
52 /**
53 * Method equals.
54 *
55 * @param other
56 * @return boolean
57 */
58 public boolean equals( Object other )
59 {
60 if ( this == other )
61 {
62 return true;
63 }
64
65 if ( !( other instanceof JdoResource ) )
66 {
67 return false;
68 }
69
70 JdoResource that = (JdoResource) other;
71 boolean result = true;
72
73 result = result && ( getIdentifier() == null ? that.getIdentifier() == null : getIdentifier().equals( that.getIdentifier() ) );
74
75 return result;
76 } //-- boolean equals( Object )
77
78 /**
79 * Get the string identifier for a resource.
80 *
81 * @return String
82 */
83 public String getIdentifier()
84 {
85 return this.identifier;
86 } //-- String getIdentifier()
87
88 /**
89 * Method hashCode.
90 *
91 * @return int
92 */
93 public int hashCode()
94 {
95 int result = 17;
96
97 result = 37 * result + ( identifier != null ? identifier.hashCode() : 0 );
98
99 return result;
100 } //-- int hashCode()
101
102 /**
103 * Get true if the identifer is a pattern that is to be
104 * evaluated, for example x.* could match x.a or x.b and x.**
105 * could match x.foo.
106 *
107 * @return boolean
108 */
109 public boolean isPattern()
110 {
111 return this.pattern;
112 } //-- boolean isPattern()
113
114 /**
115 * Get true if this object is permanent.
116 *
117 * @return boolean
118 */
119 public boolean isPermanent()
120 {
121 return this.permanent;
122 } //-- boolean isPermanent()
123
124 /**
125 * Set the string identifier for a resource.
126 *
127 * @param identifier
128 */
129 public void setIdentifier( String identifier )
130 {
131 this.identifier = identifier;
132 } //-- void setIdentifier( String )
133
134 /**
135 * Set true if the identifer is a pattern that is to be
136 * evaluated, for example x.* could match x.a or x.b and x.**
137 * could match x.foo.
138 *
139 * @param pattern
140 */
141 public void setPattern( boolean pattern )
142 {
143 this.pattern = pattern;
144 } //-- void setPattern( boolean )
145
146 /**
147 * Set true if this object is permanent.
148 *
149 * @param permanent
150 */
151 public void setPermanent( boolean permanent )
152 {
153 this.permanent = permanent;
154 } //-- void setPermanent( boolean )
155
156 /**
157 * Method toString.
158 *
159 * @return String
160 */
161 public java.lang.String toString()
162 {
163 StringBuffer buf = new StringBuffer( 128 );
164
165 buf.append( "identifier = '" );
166 buf.append( getIdentifier() );
167 buf.append( "'" );
168
169 return buf.toString();
170 } //-- java.lang.String toString()
171
172 }