@Test public void apply() { RuntimeContext applied = RuntimeContext.DEFAULT.apply(new HashMap<String, String>()); assertThat(applied, is(RuntimeContext.DEFAULT)); }
public RuntimeContext apply(Map<String, String> newValueMap) { if (newValueMap == null) { throw new IllegalArgumentException("newValueMap must not be null"); } RuntimeContext current = this; String newModeString = normalize(newValueMap.get(KEY_EXECUTION_MODE)); if (newModeString != null) { ExecutionMode newMode = ExecutionMode.fromSymbol(newModeString); if (newMode != null) { current = current.mode(newMode); } else { if (LOG.isLoggable(Level.WARNING)) { LOG.warning(MessageFormat.format( "Invalid execution mode: {0}={1}", KEY_EXECUTION_MODE, newModeString)); } } } String newBatchId = normalize(newValueMap.get(KEY_BATCH_ID)); if (newBatchId != null) { current = current.batchId(newBatchId); } String newVerificationCode = normalize(newValueMap.get(KEY_BUILD_ID)); if (newVerificationCode != null) { current = current.buildId(newVerificationCode); } return current; }
RuntimeContext { public RuntimeContext apply(Map<String, String> newValueMap) { if (newValueMap == null) { throw new IllegalArgumentException("newValueMap must not be null"); } RuntimeContext current = this; String newModeString = normalize(newValueMap.get(KEY_EXECUTION_MODE)); if (newModeString != null) { ExecutionMode newMode = ExecutionMode.fromSymbol(newModeString); if (newMode != null) { current = current.mode(newMode); } else { if (LOG.isLoggable(Level.WARNING)) { LOG.warning(MessageFormat.format( "Invalid execution mode: {0}={1}", KEY_EXECUTION_MODE, newModeString)); } } } String newBatchId = normalize(newValueMap.get(KEY_BATCH_ID)); if (newBatchId != null) { current = current.batchId(newBatchId); } String newVerificationCode = normalize(newValueMap.get(KEY_BUILD_ID)); if (newVerificationCode != null) { current = current.buildId(newVerificationCode); } return current; } }
RuntimeContext { public RuntimeContext apply(Map<String, String> newValueMap) { if (newValueMap == null) { throw new IllegalArgumentException("newValueMap must not be null"); } RuntimeContext current = this; String newModeString = normalize(newValueMap.get(KEY_EXECUTION_MODE)); if (newModeString != null) { ExecutionMode newMode = ExecutionMode.fromSymbol(newModeString); if (newMode != null) { current = current.mode(newMode); } else { if (LOG.isLoggable(Level.WARNING)) { LOG.warning(MessageFormat.format( "Invalid execution mode: {0}={1}", KEY_EXECUTION_MODE, newModeString)); } } } String newBatchId = normalize(newValueMap.get(KEY_BATCH_ID)); if (newBatchId != null) { current = current.batchId(newBatchId); } String newVerificationCode = normalize(newValueMap.get(KEY_BUILD_ID)); if (newVerificationCode != null) { current = current.buildId(newVerificationCode); } return current; } private  RuntimeContext(); private  RuntimeContext(ExecutionMode mode, String batchId, String verificationCode); }
RuntimeContext { public RuntimeContext apply(Map<String, String> newValueMap) { if (newValueMap == null) { throw new IllegalArgumentException("newValueMap must not be null"); } RuntimeContext current = this; String newModeString = normalize(newValueMap.get(KEY_EXECUTION_MODE)); if (newModeString != null) { ExecutionMode newMode = ExecutionMode.fromSymbol(newModeString); if (newMode != null) { current = current.mode(newMode); } else { if (LOG.isLoggable(Level.WARNING)) { LOG.warning(MessageFormat.format( "Invalid execution mode: {0}={1}", KEY_EXECUTION_MODE, newModeString)); } } } String newBatchId = normalize(newValueMap.get(KEY_BATCH_ID)); if (newBatchId != null) { current = current.batchId(newBatchId); } String newVerificationCode = normalize(newValueMap.get(KEY_BUILD_ID)); if (newVerificationCode != null) { current = current.buildId(newVerificationCode); } return current; } private  RuntimeContext(); private  RuntimeContext(ExecutionMode mode, String batchId, String verificationCode); static RuntimeContext get(); static void set(RuntimeContext context); static String getRuntimeVersion(); RuntimeContext mode(ExecutionMode newValue); RuntimeContext batchId(String newValue); RuntimeContext buildId(String newValue); RuntimeContext apply(Map<String, String> newValueMap); Map<String, String> unapply(); boolean isSimulation(); boolean canExecute(Object object); void verifyApplication(ClassLoader classLoader); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); }
RuntimeContext { public RuntimeContext apply(Map<String, String> newValueMap) { if (newValueMap == null) { throw new IllegalArgumentException("newValueMap must not be null"); } RuntimeContext current = this; String newModeString = normalize(newValueMap.get(KEY_EXECUTION_MODE)); if (newModeString != null) { ExecutionMode newMode = ExecutionMode.fromSymbol(newModeString); if (newMode != null) { current = current.mode(newMode); } else { if (LOG.isLoggable(Level.WARNING)) { LOG.warning(MessageFormat.format( "Invalid execution mode: {0}={1}", KEY_EXECUTION_MODE, newModeString)); } } } String newBatchId = normalize(newValueMap.get(KEY_BATCH_ID)); if (newBatchId != null) { current = current.batchId(newBatchId); } String newVerificationCode = normalize(newValueMap.get(KEY_BUILD_ID)); if (newVerificationCode != null) { current = current.buildId(newVerificationCode); } return current; } private  RuntimeContext(); private  RuntimeContext(ExecutionMode mode, String batchId, String verificationCode); static RuntimeContext get(); static void set(RuntimeContext context); static String getRuntimeVersion(); RuntimeContext mode(ExecutionMode newValue); RuntimeContext batchId(String newValue); RuntimeContext buildId(String newValue); RuntimeContext apply(Map<String, String> newValueMap); Map<String, String> unapply(); boolean isSimulation(); boolean canExecute(Object object); void verifyApplication(ClassLoader classLoader); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); static final RuntimeContext DEFAULT; static final String PATH_APPLICATION_INFO; static final String KEY_EXECUTION_MODE; static final String KEY_BATCH_ID; static final String KEY_FLOW_ID; static final String KEY_BUILD_ID; static final String KEY_BUILD_DATE; static final String KEY_RUNTIME_VERSION; }