KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > petals > tools > jbicommon > descriptor > SharedLibraryList


1 /**
2  * PETALS - PETALS Services Platform.
3  * Copyright (c) 2005 EBM Websourcing, http://www.ebmwebsourcing.com/
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * -------------------------------------------------------------------------
19  * $Id: SharedLibraryList.java 477 2006-05-29 15:18:07Z ddesjardins $
20  * -------------------------------------------------------------------------
21  */

22
23 package org.objectweb.petals.tools.jbicommon.descriptor;
24
25 import org.apache.commons.lang.builder.EqualsBuilder;
26 import org.apache.commons.lang.builder.HashCodeBuilder;
27 import org.apache.commons.lang.builder.ToStringBuilder;
28
29 /**
30  * Shared library list production is used together with a parametrized
31  * {@link List} to provide the pair info of shared library listing used by the
32  * component.
33  *
34  * @version $Rev: 477 $ $Date: 2006-05-29 15:18:07Z $
35  * @since Petals 1.0
36  * @author <a HREF="mailto:rmarins@fossilec.com">Rafael Marins</a>
37  */

38 public class SharedLibraryList {
39
40     /**
41      * Shared library name.
42      */

43     private String JavaDoc name;
44
45     /**
46      * Optional shared library version.
47      */

48     private String JavaDoc version;
49
50     /**
51      * Default constructor.
52      */

53     SharedLibraryList() {
54         super();
55     }
56
57     @Override JavaDoc
58     public boolean equals(final Object JavaDoc other) {
59         if (!(other instanceof SharedLibraryList)) {
60             return false; // NOPMD by gblondelle
61
}
62         SharedLibraryList castOther = (SharedLibraryList) other;
63         return new EqualsBuilder().append(name, castOther.name).append(version,
64                 castOther.version).isEquals();
65     }
66
67     /**
68      * Returns the shared library name.
69      *
70      * @return <code>String</code> the shared library name.
71      */

72     public String JavaDoc getName() {
73         return name;
74     }
75
76     /**
77      * Returns the shared library version. May be <code>null</code> since it's
78      * optional.
79      *
80      * @return <code>String</code> optional shared library version.
81      */

82     public String JavaDoc getVersion() {
83         return version;
84     }
85
86     //
87
// Getters and Setters
88
//
89

90     @Override JavaDoc
91     public int hashCode() {
92         return new HashCodeBuilder().append(name).append(version).toHashCode();
93     }
94
95     @Override JavaDoc
96     public String JavaDoc toString() {
97         return new ToStringBuilder(this).append("name", name).append("version",
98                 version).toString();
99     }
100
101     /**
102      * Set shared library name.
103      *
104      * @param name
105      * <code>String</code> shared library name.
106      */

107     void setName(final String JavaDoc name) {
108         this.name = name;
109     }
110
111     /**
112      * Set the optional shared library version.
113      *
114      * @param version
115      * <code>String</code> shared library version.
116      */

117     void setVersion(final String JavaDoc version) {
118         this.version = version;
119     }
120
121 }
122
Popular Tags