1 8 package org.apache.avalon.phoenix.components.configuration; 9 10 final class ConfigurationKey 11 { 12 private final String m_application; 13 14 private final String m_block; 15 16 public ConfigurationKey( String application, String block ) 17 { 18 this.m_application = application; 19 this.m_block = block; 20 } 21 22 public int hashCode() 23 { 24 return this.getApplication().hashCode() + this.getBlock().hashCode(); 25 } 26 27 public boolean equals( Object obj ) 28 { 29 if( obj instanceof ConfigurationKey ) 30 { 31 final ConfigurationKey key = (ConfigurationKey)obj; 32 33 return this.getApplication().equals( key.getApplication() ) 34 && this.getBlock().equals( key.getBlock() ); 35 } 36 else 37 { 38 return false; 39 } 40 } 41 42 public String getApplication() 43 { 44 return m_application; 45 } 46 47 public String getBlock() 48 { 49 return m_block; 50 } 51 } 52 | Popular Tags |