KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > directory > ldapstudio > schemas > view > editors > NonExistingObjectClass


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the
7  * "License"); you may not use this file except in compliance
8  * with the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  * KIND, either express or implied. See the License for the
16  * specific language governing permissions and limitations
17  * under the License.
18  *
19  */

20 package org.apache.directory.ldapstudio.schemas.view.editors;
21
22
23 import org.apache.directory.ldapstudio.schemas.Messages;
24
25
26 /**
27  * This class implements the Non Existing Object Class.
28  *
29  * @author <a HREF="mailto:dev@directory.apache.org">Apache Directory Project</a>
30  * @version $Rev$, $Date$
31  */

32 public class NonExistingObjectClass
33 {
34     public static final String JavaDoc NONE = Messages.getString( "NonExistingObjectClass.(None)" ); //$NON-NLS-1$
35

36     /** The name */
37     private String JavaDoc name;
38
39
40     /**
41      * Creates a new instance of NonExistingObjectClass.
42      *
43      * @param name
44      * the name the NonExistingObjectClass
45      */

46     public NonExistingObjectClass( String JavaDoc name )
47     {
48         this.name = name;
49     }
50
51
52     /**
53      * Gets the name of the NonExistingObjectClass.
54      *
55      * @return
56      * the name of the NonExistingObjectClass
57      */

58     public String JavaDoc getName()
59     {
60         return name;
61     }
62
63
64     /**
65      * Gets the displayable name of the NonExistingObjectClass.
66      *
67      * @return
68      * the displayable name of the NonExistingObjectClass
69      */

70     public String JavaDoc getDisplayName()
71     {
72         if ( name.equals( NONE ) )
73         {
74             return NONE;
75         }
76         else
77         {
78             return name + " " + Messages.getString( "NonExistingObjectClass.(This_object_class_doesnt_exist)" ); //$NON-NLS-1$ //$NON-NLS-2$
79
}
80     }
81
82
83     /* (non-Javadoc)
84      * @see java.lang.Object#equals(java.lang.Object)
85      */

86     public boolean equals( Object JavaDoc obj )
87     {
88         if ( obj instanceof NonExistingObjectClass )
89         {
90             return name.equalsIgnoreCase( ( ( NonExistingObjectClass ) obj ).getName() );
91         }
92
93         return false;
94     }
95 }
96
Popular Tags