KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ltk > core > refactoring > GroupCategory


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.ltk.core.refactoring;
12
13 import org.eclipse.core.runtime.Assert;
14
15 /**
16  * A group category is used to annotate change groups so that
17  * they can be identified and filtered.
18  * <p>
19  * Note: this class is not intended to be subclassed
20  * </p>
21  *
22  * @since 3.2
23  */

24 public class GroupCategory {
25     
26     private String JavaDoc fId;
27     private String JavaDoc fName;
28     private String JavaDoc fDescription;
29
30     /**
31      * Creates a new group category with the given name and
32      * description.
33      *
34      * @param id a unique identifier
35      * @param name the name
36      * @param description the description
37      */

38     public GroupCategory(String JavaDoc id, String JavaDoc name, String JavaDoc description) {
39         Assert.isNotNull(id);
40         Assert.isNotNull(name);
41         Assert.isNotNull(description);
42         fId= id;
43         fName= name;
44         fDescription= description;
45     }
46     
47     /**
48      * Returns the name of the group category.
49      *
50      * @return the name
51      */

52     public String JavaDoc getName() {
53         return fName;
54     }
55     
56     /**
57      * Returns the description of the group category.
58      *
59      * @return the description
60      */

61     public String JavaDoc getDescription() {
62         return fDescription;
63     }
64     
65     public boolean equals(Object JavaDoc obj) {
66         if (this == obj)
67             return true;
68         if (obj == null || !getClass().equals(obj.getClass()))
69             return false;
70         return fId.equals(((GroupCategory)obj).fId);
71     }
72     
73     public int hashCode() {
74         return fId.hashCode();
75     }
76 }
77
Popular Tags