KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mule > impl > container > DescriptorContainerKeyPair


1 /*
2  * $Id: DescriptorContainerKeyPair.java 4259 2006-12-14 03:12:07Z aperepel $
3  * --------------------------------------------------------------------------------------
4  * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
5  *
6  * The software in this package is published under the terms of the MuleSource MPL
7  * license, a copy of which has been included with this distribution in the
8  * LICENSE.txt file.
9  */

10
11 package org.mule.impl.container;
12
13 public class DescriptorContainerKeyPair extends ContainerKeyPair
14 {
15     private String JavaDoc descriptorName;
16
17     public DescriptorContainerKeyPair(String JavaDoc descriptorName, Object JavaDoc key)
18     {
19         super(DescriptorContainerContext.DESCRIPTOR_CONTAINER_NAME, key);
20         this.descriptorName = descriptorName;
21     }
22
23     public String JavaDoc getDescriptorName()
24     {
25         return descriptorName;
26     }
27
28     public String JavaDoc toFullString()
29     {
30         return "Descriptor Container Key{name=" + descriptorName + ", key=" + getKey().toString()
31                         + ", container=" + getContainerName() + ", required=" + isRequired() + "}";
32     }
33
34     public boolean equals(Object JavaDoc o)
35     {
36         if (this == o) return true;
37         if (o == null || getClass() != o.getClass()) return false;
38         if (!super.equals(o)) return false;
39
40         final DescriptorContainerKeyPair that = (DescriptorContainerKeyPair)o;
41
42         if (descriptorName != null
43                         ? !descriptorName.equals(that.descriptorName) : that.descriptorName != null)
44             return false;
45
46         return true;
47     }
48
49     public int hashCode()
50     {
51         return 29 * super.hashCode() + (descriptorName != null ? descriptorName.hashCode() : 0);
52     }
53 }
54
Popular Tags