public Optional<TopologyVersion> getLatestVersionInfo(Long topologyId) { Collection<TopologyVersion> versions = listTopologyVersionInfos(WSUtils.buildTopologyIdAwareQueryParams(topologyId, null)); return versions.stream() .filter(v -> !v.getName().equals(CURRENT_VERSION)) .max((versionInfo1, versionInfo2) -> { // compares the number part from version strings like V1, V2 ... return versionInfo1.getVersionNumber() - versionInfo2.getVersionNumber(); }); } public TopologyVersion getTopologyVersionInfo(Long versionId) {
public TopologyVersion(TopologyVersion other) { if (other != null) { setId(other.getId()); setTopologyId(other.getTopologyId()); setName(other.getName()); setDescription(other.getDescription()); setTimestamp(other.getTimestamp()); } }