I have enum class which consists of bigint constants.
public enum Constants {
CONST1(new BigInteger("12783786")),
CONST2(new BigInteger("489578758"));
BigInteger id;
Constants(BigInteger id) {
this.id = id;
}
BigInteger getId() {
return id;
}
}
Is there any default method which will be called when enum is passed to a method as an argument. Now for a method like process(BigInteger id) i have to write code like process(CONST1.getId()). I want it to look like process(CONST1). Thanks a lot for answers.