simerplaha / SwayDB

Persistent and in-memory key-value storage engine for JVM that scales on a single machine.
https://swaydb.simer.au
Apache License 2.0
293 stars 16 forks source link

Java KeyVal and Pair should not require type conversions #324

Open simerplaha opened 2 years ago

simerplaha commented 2 years ago

Issue

scala.Tuple2[T1, T2]'s equivalent in Java is KeyVal[K, V] and Pair[L, R] which requires type conversion to Tuple2 so it could be used by core.

Solution

Copy the implementation of scala.Tuple2[T1, T2] as a sealed trait making KeyVal[K, V] or Pair[L, R] extend it.