public VersionDto toVersionDto() { return new VersionDto(id, version); }
/** * Return instance that contains only schema id and version. * */ public VersionDto toVersionDto() { VersionDto dto = new VersionDto(); dto.setId(getStringId()); dto.setVersion(version); return dto; } }
private List<VersionDto> extractEndpointProfileVersions(VersionDto serverProfileVersion) { Set<VersionDto> endpointProfileVersions = new HashSet<>(); if (profileVersionPairs != null) { for (ProfileVersionPairDto profileVersionPair : profileVersionPairs) { if (serverProfileVersion == null || profileVersionPair.getServerProfileSchemaVersion() == null || profileVersionPair.getServerProfileSchemaVersion().intValue() == serverProfileVersion.getVersion()) { String schemaId = profileVersionPair.getEndpointProfileSchemaid(); int version = profileVersionPair.getEndpointProfileSchemaVersion() != null ? profileVersionPair.getEndpointProfileSchemaVersion().intValue() : -1; VersionDto endpointProfileVersion = new VersionDto(schemaId, version); endpointProfileVersions.add(endpointProfileVersion); } } } List<VersionDto> endpointProfileVersionsList = new ArrayList<>(endpointProfileVersions); Collections.sort(endpointProfileVersionsList); return endpointProfileVersionsList; }
/** * Return <code>VersionDto</code> instance that contain id and version of schema. * * @return dto */ public VersionDto toVersionDto() { VersionDto dto = new VersionDto(); dto.setId(getStringId()); dto.setVersion(version); return dto; } }
private List<VersionDto> extractServerProfileVersions(VersionDto endpointProfileVersion) { Set<VersionDto> serverProfileVersions = new HashSet<>(); if (profileVersionPairs != null) { for (ProfileVersionPairDto profileVersionPair : profileVersionPairs) { if (endpointProfileVersion == null || profileVersionPair.getEndpointProfileSchemaVersion() == null || profileVersionPair.getEndpointProfileSchemaVersion().intValue() == endpointProfileVersion.getVersion()) { String schemaId = profileVersionPair.getServerProfileSchemaid(); int version = profileVersionPair.getServerProfileSchemaVersion() != null ? profileVersionPair.getServerProfileSchemaVersion().intValue() : -1; VersionDto serverProfileVersion = new VersionDto(schemaId, version); serverProfileVersions.add(serverProfileVersion); } } } List<VersionDto> serverProfileVersionsList = new ArrayList<>(serverProfileVersions); Collections.sort(serverProfileVersionsList); return serverProfileVersionsList; }