public StackComponentDtoImpl(org.eclipse.che.api.workspace.shared.dto.stack.StackComponentDto origin) { this.version = origin.getVersion(); this.name = origin.getName(); }
public StackDtoImpl(org.eclipse.che.api.workspace.shared.dto.stack.StackDto origin) { this.name = origin.getName(); java.util.List<org.eclipse.che.api.workspace.shared.dto.stack.StackComponentDto> componentsIn = origin.getComponents(); if (componentsIn != null) { java.util.List<org.eclipse.che.api.workspace.shared.dto.stack.StackComponentDto> componentsOut = new java.util.ArrayList<org.eclipse.che.api.workspace.shared.dto.stack.StackComponentDto>(); java.util.List<java.lang.String> tagsIn = origin.getTags(); if (tagsIn != null) { java.util.List<java.lang.String> tagsOut = new java.util.ArrayList<java.lang.String>(); this.id = origin.getId(); org.eclipse.che.api.workspace.shared.dto.WorkspaceConfigDto workspaceConfigIn = origin.getWorkspaceConfig(); this.workspaceConfig = workspaceConfigIn == null ? null : new WorkspaceConfigDtoImpl(workspaceConfigIn); this.description = origin.getDescription(); this.creator = origin.getCreator(); this.scope = origin.getScope(); java.util.List<org.eclipse.che.api.core.rest.shared.dto.Link> linksIn = origin.getLinks(); if (linksIn != null) { java.util.List<org.eclipse.che.api.core.rest.shared.dto.Link> linksOut = new java.util.ArrayList<org.eclipse.che.api.core.rest.shared.dto.Link>();
/** Convert {@link StackImpl} to {@link StackDto}. */ public static StackDto asDto(Stack stack) { WorkspaceConfigDto workspaceConfigDto = null; if (stack.getWorkspaceConfig() != null) { workspaceConfigDto = asDto(stack.getWorkspaceConfig()); } List<StackComponentDto> componentsDto = null; if (stack.getComponents() != null) { componentsDto = stack .getComponents() .stream() .map( component -> newDto(StackComponentDto.class) .withName(component.getName()) .withVersion(component.getVersion())) .collect(toList()); } return newDto(StackDto.class) .withId(stack.getId()) .withName(stack.getName()) .withDescription(stack.getDescription()) .withCreator(stack.getCreator()) .withScope(stack.getScope()) .withTags(stack.getTags()) .withComponents(componentsDto) .withWorkspaceConfig(workspaceConfigDto); }
StackImpl.builder() .setId(id) .setName(updateDto.getName()) .setDescription(updateDto.getDescription()) .setScope(updateDto.getScope()) .setTags(updateDto.getTags()) .setWorkspaceConfig(updateDto.getWorkspaceConfig()) .setComponents(updateDto.getComponents()) .build();
links.add(getIconLink); return asDto(stack).withLinks(links);
StackImpl.builder() .generateId() .setName(stackDto.getName()) .setDescription(stackDto.getDescription()) .setScope(stackDto.getScope()) .setCreator(userId) .setTags(stackDto.getTags()) .setWorkspaceConfig(stackDto.getWorkspaceConfig()) .setComponents(stackDto.getComponents()) .build(); stackDao.create(newStack);