public ItemReferenceImpl(org.eclipse.che.api.project.shared.dto.ItemReference origin) { this.name = origin.getName(); java.util.Map<java.lang.String, java.lang.String> attributesIn = origin.getAttributes(); if (attributesIn != null) { java.util.Map<java.lang.String, java.lang.String> attributesOut = new java.util.HashMap<java.lang.String, java.lang.String>(); for (java.util.Map.Entry<String, java.lang.String> entry0 : attributesIn.entrySet()) { java.lang.String attributesIn_ = entry0.getValue(); attributesOut.put(entry0.getKey(), attributesIn_); } this.attributes = attributesOut; } this.modified = origin.getModified(); this.type = origin.getType(); this.path = origin.getPath(); this.projectConfig = origin.getProjectConfig(); this.contentLength = origin.getContentLength(); this.project = origin.getProject(); 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>(); for (org.eclipse.che.api.core.rest.shared.dto.Link linksIn_ : linksIn) { linksOut.add(linksIn_); } this.links = linksOut; } }
public SearchItemReference(SearchResultDto searchResultDto) { name = searchResultDto.getItemReference().getName(); path = searchResultDto.getItemReference().getPath(); project = searchResultDto.getItemReference().getProject(); if (searchResultDto.getItemReference().getLink(Constants.LINK_REL_GET_CONTENT) != null) { contentUrl = searchResultDto.getItemReference().getLink(Constants.LINK_REL_GET_CONTENT).getHref(); } final List<SearchOccurrenceDto> dtos = searchResultDto.getSearchOccurrences(); occurrences = new ArrayList<>(dtos.size()); for (SearchOccurrence dto : dtos) { occurrences.add(new SearchOccurrenceImpl(dto)); } }