1 18 19 package org.apache.beehive.netui.tools.testrecorder.shared.config; 20 21 import org.apache.beehive.netui.tools.testrecorder.shared.util.StringHelper; 22 23 import java.util.List ; 24 import java.util.Map ; 25 import java.util.HashMap ; 26 import java.util.Collections ; 27 28 33 public class Webapps { 34 35 private List webappList; 37 private Map webappNameMap; 39 40 public Webapps( List webappList ) { 41 this.webappList = webappList; 42 webappNameMap = new HashMap (); 43 init(); 44 } 45 46 private void init() { 47 WebappConfig webapp = null; 48 for ( int i = 0; i < webappList.size(); i++ ) { 49 webapp = (WebappConfig) webappList.get( i ); 50 webappNameMap.put( webapp.getName(), webapp ); 51 } 52 } 53 54 public List getWebappList() { 55 return Collections.unmodifiableList( webappList ); 56 } 57 58 private Map getWebappNameMap() { 59 return webappNameMap; 60 } 61 62 public WebappConfig getWebapp( String name ) { 63 return (WebappConfig) getWebappNameMap().get( name ); 64 } 65 66 public String toString() { 67 StringBuffer sb = new StringBuffer ( 256 ); 68 sb.append( "[ " ); 69 sb.append( ", webappList( " + StringHelper.toString( getWebappList(), "\n", "\n\t" ) + " )" ); 70 sb.append( " ]" ); 71 return sb.toString(); 72 } 73 74 } 75 | Popular Tags |