This project has retired. For details please refer to its Attic page.
JdoPermission xref
View Javadoc

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    * Class JdoPermission.
10   * 
11   * @version $Revision$ $Date$
12   */
13  public class JdoPermission
14      implements org.apache.archiva.redback.rbac.Permission, java.io.Serializable
15  {
16  
17        //--------------------------/
18       //- Class/Member Variables -/
19      //--------------------------/
20  
21      /**
22       * Field name.
23       */
24      private String name;
25  
26      /**
27       * Field description.
28       */
29      private String description;
30  
31      /**
32       * 
33       *             true if this object is permanent.
34       *           
35       */
36      private boolean permanent = false;
37  
38      /**
39       * Field operation.
40       */
41      private JdoOperation operation;
42  
43      /**
44       * Field resource.
45       */
46      private JdoResource resource;
47  
48  
49        //-----------/
50       //- Methods -/
51      //-----------/
52  
53      /**
54       * Method equals.
55       * 
56       * @param other
57       * @return boolean
58       */
59      public boolean equals( Object other )
60      {
61          if ( this == other )
62          {
63              return true;
64          }
65  
66          if ( !( other instanceof JdoPermission ) )
67          {
68              return false;
69          }
70  
71          JdoPermission that = (JdoPermission) other;
72          boolean result = true;
73  
74          result = result && ( getName() == null ? that.getName() == null : getName().equals( that.getName() ) );
75  
76          return result;
77      } //-- boolean equals( Object )
78  
79      /**
80       * Get the description field.
81       * 
82       * @return String
83       */
84      public String getDescription()
85      {
86          return this.description;
87      } //-- String getDescription()
88  
89      /**
90       * Get the name field.
91       * 
92       * @return String
93       */
94      public String getName()
95      {
96          return this.name;
97      } //-- String getName()
98  
99      /**
100      * Get the operation field.
101      * 
102      * @return Operation
103      */
104     public org.apache.archiva.redback.rbac.Operation getOperation()
105     {
106         return (org.apache.archiva.redback.rbac.Operation) this.operation;
107     } //-- org.apache.archiva.redback.rbac.Operation getOperation()
108 
109     /**
110      * Get the resource field.
111      * 
112      * @return Resource
113      */
114     public org.apache.archiva.redback.rbac.Resource getResource()
115     {
116         return (org.apache.archiva.redback.rbac.Resource) this.resource;
117     } //-- org.apache.archiva.redback.rbac.Resource getResource()
118 
119     /**
120      * Method hashCode.
121      * 
122      * @return int
123      */
124     public int hashCode()
125     {
126         int result = 17;
127 
128         result = 37 * result + ( name != null ? name.hashCode() : 0 );
129 
130         return result;
131     } //-- int hashCode()
132 
133     /**
134      * Get true if this object is permanent.
135      * 
136      * @return boolean
137      */
138     public boolean isPermanent()
139     {
140         return this.permanent;
141     } //-- boolean isPermanent()
142 
143     /**
144      * Set the description field.
145      * 
146      * @param description
147      */
148     public void setDescription( String description )
149     {
150         this.description = description;
151     } //-- void setDescription( String )
152 
153     /**
154      * Set the name field.
155      * 
156      * @param name
157      */
158     public void setName( String name )
159     {
160         this.name = name;
161     } //-- void setName( String )
162 
163     /**
164      * Set the operation field.
165      * 
166      * @param operation
167      */
168     public void setOperation( org.apache.archiva.redback.rbac.Operation operation )
169     {
170         if ( operation != null && !( operation instanceof JdoOperation ) )
171         {
172             throw new ClassCastException( "JdoPermission.setOperation( operation ) parameter must be instanceof " + JdoOperation.class.getName() );
173         }
174         this.operation = (JdoOperation) operation;
175     } //-- void setOperation( org.apache.archiva.redback.rbac.Operation )
176 
177     /**
178      * Set true if this object is permanent.
179      * 
180      * @param permanent
181      */
182     public void setPermanent( boolean permanent )
183     {
184         this.permanent = permanent;
185     } //-- void setPermanent( boolean )
186 
187     /**
188      * Set the resource field.
189      * 
190      * @param resource
191      */
192     public void setResource( org.apache.archiva.redback.rbac.Resource resource )
193     {
194         if ( resource != null && !( resource instanceof JdoResource ) )
195         {
196             throw new ClassCastException( "JdoPermission.setResource( resource ) parameter must be instanceof " + JdoResource.class.getName() );
197         }
198         this.resource = (JdoResource) resource;
199     } //-- void setResource( org.apache.archiva.redback.rbac.Resource )
200 
201     /**
202      * Method toString.
203      * 
204      * @return String
205      */
206     public java.lang.String toString()
207     {
208         StringBuffer buf = new StringBuffer( 128 );
209 
210         buf.append( "name = '" );
211         buf.append( getName() );
212         buf.append( "'" );
213 
214         return buf.toString();
215     } //-- java.lang.String toString()
216 
217 }