public RuntimeImpl(Runtime runtime) { this.activeEnv = runtime.getActiveEnv(); this.machines = runtime .getMachines() .entrySet() .stream() .collect(Collectors.toMap(Map.Entry::getKey, e -> new MachineImpl(e.getValue()))); this.owner = runtime.getOwner(); this.warnings = runtime.getWarnings().stream().map(WarningImpl::new).collect(Collectors.toList()); this.commands = runtime.getCommands().stream().map(CommandImpl::new).collect(Collectors.toList()); }
public WorkspaceImpl( String id, Account account, WorkspaceConfig config, Runtime runtime, Map<String, String> attributes, boolean isTemporary, WorkspaceStatus status) { this.id = id; if (account != null) { this.account = new AccountImpl(account); } if (config != null) { this.config = new WorkspaceConfigImpl(config); } if (runtime != null) { this.runtime = new RuntimeImpl( runtime.getActiveEnv(), runtime.getMachines(), runtime.getOwner(), runtime.getCommands(), runtime.getWarnings()); } if (attributes != null) { this.attributes = new HashMap<>(attributes); } this.isTemporary = isTemporary; this.status = status; }
runtime.getActiveEnv(), runtime.getMachines(), runtime.getOwner(), machineToken, runtime.getCommands(),