Right now the interface looks like this:
var meta = new BDict(
new BString("announce"), new BString(announce),
new BString("created by"), new BString(createdBy),
new BString("comment"), new BString(comment),
new BString("encoding"), new BString(encoding),
new BString("info"), new BDict(
new BString("length"), new BInt(length)));
public BDict(BValue<?>... kv) {
Is there any way I can take either String or Int in vargs and then dispatch correct constructor (either BInt or BString) so this looks something like:
new BDict("announce", announce, "length", 2137)
I looked at stdlib but they do this strange way
https://github.com/openjdk/jdk/blob/8073914af7d4ddd7bbd93d75104c7637e38a7ad9/src/java.base/share/classes/java/util/Map.java#L1623
GitHub
JDK main-line development https://openjdk.org/projects/jdk - openjdk/jdk