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