```public interface ResourceManager<R extends N...
# announcements
j
Copy code
public interface ResourceManager<R extends NodeReadOnlyTrx & NodeCursor, W extends NodeTrx & NodeCursor>
d
Multiple generic bounds are expressed through `where`: https://kotlinlang.org/docs/reference/generics.html#upper-bounds
j
Copy code
fun <R, W> getRevisionNumber(rev: String?, revTimestamp: String?, manager: ResourceManager<R, W>): Array<Int>
        where R : NodeReadOnlyTrx,
              R : NodeCursor,
              W : NodeTrx,
              W : NodeCursor {
works, thanks 🙂
BTW: If I have a bunch of methods with ResourceManager<R,W> as a parameter, can I make this more clean (less repetitive)? I guess that's the best way, though
t
You could write interfaces that extends from both types, so that you can use a shorter syntax :
Copy code
interface NodeReadOnlyTrxCursor : NodeReadOnlyTrx, NodeCursor

interface NodeTrxCursor : NodeTrx, NodeCursor

fun <R : NodeReadOnlyTrxCursor, W : NodeTrxCursor> getRevisionNumber(rev: String? revTimestamp: String?, manager: ResourceManager<R, W>): Array<Int> { ... }