Added ProtocolVersion.allKnownProtocolVersions() method

This commit is contained in:
Marc Baloup 2023-06-17 11:43:37 +02:00
parent 98d1a21aab
commit 9f9fb55726

View File

@ -141,6 +141,17 @@ public class ProtocolVersion {
}
/**
* Returns all the {@link ProtocolVersion} currently known by this class.
* @return all the {@link ProtocolVersion} currently known by this class.
*/
public static List<ProtocolVersion> allKnownProtocolVersions() {
return versionList.get().versionsOfProtocol().keySet().stream()
.map(ProtocolVersion::ofProtocol)
.toList();
}
/**