1 50 51 package org.apache.avalon.meta.info; 52 53 import java.util.Properties ; 54 55 76 public class ServiceDescriptor 77 extends Descriptor 78 { 79 82 private final ReferenceDescriptor m_designator; 83 84 90 public ServiceDescriptor( final ServiceDescriptor descriptor ) 91 throws NullPointerException 92 { 93 super( descriptor.getProperties() ); 94 m_designator = descriptor.getReference(); 95 } 96 97 98 104 public ServiceDescriptor( final ReferenceDescriptor designator ) 105 throws NullPointerException 106 { 107 this( designator, null ); 108 } 109 110 117 public ServiceDescriptor( final ReferenceDescriptor designator, 118 final Properties attributes ) 119 throws NullPointerException 120 { 121 super( attributes ); 122 123 if ( null == designator ) 124 { 125 throw new NullPointerException ( "designator" ); 126 } 127 128 m_designator = designator; 129 } 130 131 136 public ReferenceDescriptor getReference() 137 { 138 return m_designator; 139 } 140 141 145 public int hashCode() 146 { 147 return m_designator.hashCode(); 148 } 149 150 154 public boolean equals(Object other) 155 { 156 boolean isEqual = super.equals( other ) && other instanceof ServiceDescriptor; 157 isEqual = isEqual && m_designator.equals( ( (ServiceDescriptor) other ).m_designator ); 158 return isEqual; 159 } 160 } 161 | Popular Tags |