View Javadoc

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