public void setPhaseOptionIfUnset(String phaseName, String option) { Map<String, String> optionMap = mapForPhase(phaseName); if (optionMap == null) { throw new RuntimeException("No such phase " + phaseName); } if (optionMap.containsKey(getKey(option))) { return; } if (!declaresOption(phaseName, getKey(option))) { throw new RuntimeException("No option " + option + " for phase " + phaseName); } optionMap.put(getKey(option), getValue(option)); }
public Map<String, String> getPhaseOptions(HasPhaseOptions phase) { Map<String, String> ret = phaseToOptionMap.get(phase); if (ret == null) { ret = new HashMap<String, String>(); } else { ret = new HashMap<String, String>(ret); } StringTokenizer st = new StringTokenizer(phase.getDefaultOptions()); while (st.hasMoreTokens()) { String opt = st.nextToken(); String key = getKey(opt); String value = getValue(opt); if (!ret.containsKey(key)) { ret.put(key, value); } } return Collections.unmodifiableMap(ret); }
public boolean setPhaseOption(HasPhaseOptions phase, String option) { Map<String, String> optionMap = mapForPhase(phase); if (!checkParentEnabled(phase.getPhaseName())) { return false; } if (optionMap == null) { logger.debug("" + "Option " + option + " given for nonexistent" + " phase " + phase.getPhaseName()); return false; } String key = getKey(option); if (key.equals("enabled") && getValue(option).equals("true")) { resetRadioPack(phase.getPhaseName()); } if (declaresOption(phase, key)) { optionMap.put(key, getValue(option)); return true; } logger.debug("" + "Invalid option " + option + " for phase " + phase.getPhaseName()); return false; }
public void setPhaseOptionIfUnset( String phaseName, String option ) { Map<String, String> optionMap = mapForPhase( phaseName ); if( optionMap == null ) throw new RuntimeException( "No such phase "+phaseName ); if( optionMap.containsKey( getKey( option ) ) ) return; if( !declaresOption( phaseName, getKey( option ) ) ) throw new RuntimeException( "No option "+option+" for phase "+phaseName ); optionMap.put( getKey( option ), getValue( option ) ); }
public void setPhaseOptionIfUnset( String phaseName, String option ) { Map<String, String> optionMap = mapForPhase( phaseName ); if( optionMap == null ) throw new RuntimeException( "No such phase "+phaseName ); if( optionMap.containsKey( getKey( option ) ) ) return; if( !declaresOption( phaseName, getKey( option ) ) ) throw new RuntimeException( "No option "+option+" for phase "+phaseName ); optionMap.put( getKey( option ), getValue( option ) ); }
public Map getPhaseOptions(HasPhaseOptions phase) { Map ret = phaseToOptionMap.get(phase); if( ret == null ) ret = new HashMap(); else ret = new HashMap( ret ); StringTokenizer st = new StringTokenizer( phase.getDefaultOptions() ); while( st.hasMoreTokens() ) { String opt = st.nextToken(); String key = getKey( opt ); String value = getValue( opt ); if( !ret.containsKey( key ) ) ret.put( key, value ); } return Collections.unmodifiableMap(ret); }
public Map getPhaseOptions(HasPhaseOptions phase) { Map ret = phaseToOptionMap.get(phase); if( ret == null ) ret = new HashMap(); else ret = new HashMap( ret ); StringTokenizer st = new StringTokenizer( phase.getDefaultOptions() ); while( st.hasMoreTokens() ) { String opt = st.nextToken(); String key = getKey( opt ); String value = getValue( opt ); if( !ret.containsKey( key ) ) ret.put( key, value ); } return Collections.unmodifiableMap(ret); }
public boolean setPhaseOption( HasPhaseOptions phase, String option ) { Map<String, String> optionMap = mapForPhase( phase ); if( !checkParentEnabled( phase.getPhaseName() ) ) return false; if( optionMap == null ) { G.v().out.println( "Option "+option+" given for nonexistent" +" phase "+phase.getPhaseName() ); return false; } String key = getKey( option ); if( key.equals( "enabled" ) && getValue( option ).equals( "true" ) ) { resetRadioPack( phase.getPhaseName() ); } if( declaresOption( phase, key ) ) { optionMap.put( key, getValue( option ) ); return true; } G.v().out.println( "Invalid option "+option+" for phase "+phase.getPhaseName() ); return false; }
public boolean setPhaseOption( HasPhaseOptions phase, String option ) { Map<String, String> optionMap = mapForPhase( phase ); if( !checkParentEnabled( phase.getPhaseName() ) ) return false; if( optionMap == null ) { G.v().out.println( "Option "+option+" given for nonexistent" +" phase "+phase.getPhaseName() ); return false; } String key = getKey( option ); if( key.equals( "enabled" ) && getValue( option ).equals( "true" ) ) { resetRadioPack( phase.getPhaseName() ); } if( declaresOption( phase, key ) ) { optionMap.put( key, getValue( option ) ); return true; } G.v().out.println( "Invalid option "+option+" for phase "+phase.getPhaseName() ); return false; }