How do I reference Enum constant which is enclosed inside a Java class from Clojure? I'm trying to use the field P2PKH
from org.bitcoinj.script.Script.ScriptType
. See API of bitcoinj.
In a Java interop guide they say:
You can refer to those enumerations in Clojure like this:
DaysOfWeek/TUESDAY
But that doesn't work when the Enum is enclosed in a class. What would be the correct syntax?
You need to use syntax for accessing static inner classes:
OuterClass$InnerClass/staticField
so it should be:
org.bitcoinj.script.Script$ScriptType/P2PKH
.