I have a Java enum with an object reference stored in a field. How can I get hold of that reference from outside the enum?
public enum TisztításiEljárás {
BIO_TISZTÍTÁS(new Időtartam(3, 20))
private Időtartam javasoltVállalás;
private TisztításiEljárás(Időtartam i) {
javasoltVállalás = i;
}
}
Just as if it was a class.
Make the field public, or add a
getmethod in the enum.Use it like this: