View Javadoc

1   /*
2    * Copyright 2011 Vincent Behar
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.rundeck.api.domain;
17  
18  import java.io.Serializable;
19  
20  /**
21   * Represents a RunDeck project
22   * 
23   * @author Vincent Behar
24   */
25  public class RundeckProject implements Serializable {
26  
27      private static final long serialVersionUID = 1L;
28  
29      private String name;
30  
31      private String description;
32  
33      public String getName() {
34          return name;
35      }
36  
37      public void setName(String name) {
38          this.name = name;
39      }
40  
41      public String getDescription() {
42          return description;
43      }
44  
45      public void setDescription(String description) {
46          this.description = description;
47      }
48  
49      @Override
50      public String toString() {
51          return "RundeckProject [name=" + name + ", description=" + description + "]";
52      }
53  
54      @Override
55      public int hashCode() {
56          final int prime = 31;
57          int result = 1;
58          result = prime * result + ((description == null) ? 0 : description.hashCode());
59          result = prime * result + ((name == null) ? 0 : name.hashCode());
60          return result;
61      }
62  
63      @Override
64      public boolean equals(Object obj) {
65          if (this == obj)
66              return true;
67          if (obj == null)
68              return false;
69          if (getClass() != obj.getClass())
70              return false;
71          RundeckProject other = (RundeckProject) obj;
72          if (description == null) {
73              if (other.description != null)
74                  return false;
75          } else if (!description.equals(other.description))
76              return false;
77          if (name == null) {
78              if (other.name != null)
79                  return false;
80          } else if (!name.equals(other.name))
81              return false;
82          return true;
83      }
84  
85  }