1 50 51 package org.apache.avalon.meta.info; 52 53 import java.util.Properties ; 54 55 61 public final class ExtensionDescriptor extends Descriptor 62 { 63 66 private final String m_urn; 67 68 73 public ExtensionDescriptor( final String urn ) 74 throws NullPointerException 75 { 76 this( urn, null ); 77 } 78 79 85 public ExtensionDescriptor( final String urn, 86 final Properties attributes ) 87 throws NullPointerException 88 { 89 super( attributes ); 90 91 if ( null == urn ) 92 { 93 throw new NullPointerException ( "urn" ); 94 } 95 96 m_urn = urn; 97 } 98 99 104 public String getKey() 105 { 106 return m_urn; 107 } 108 109 113 public boolean equals(Object other) 114 { 115 if( other instanceof ExtensionDescriptor ) 116 { 117 if( super.equals( other ) ) 118 { 119 return m_urn.equals( ((ExtensionDescriptor)other).m_urn ); 120 } 121 } 122 return false; 123 } 124 125 129 public int hashCode() 130 { 131 int hash = super.hashCode(); 132 hash >>>= 17; 133 hash ^= m_urn.hashCode(); 134 return hash; 135 } 136 137 141 public String toString() 142 { 143 return "[extension " + getKey() + "]"; 144 } 145 146 } 147 | Popular Tags |