Created
September 25, 2012 21:59
-
-
Save electrum/3784732 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package javatest; | |
import com.google.common.base.*; | |
import java.util.Arrays; | |
public enum RecursiveEnum | |
{ | |
FOO(null), | |
BAR(FOO); | |
private final RecursiveEnum type; | |
RecursiveEnum(RecursiveEnum type) | |
{ | |
this.type = type; | |
} | |
public RecursiveEnum getType() | |
{ | |
return type; | |
} | |
@Override | |
public String toString() | |
{ | |
return Objects.toStringHelper(this) | |
.add("name", name()) | |
.add("type", type) | |
.toString(); | |
} | |
public static void main(String[] args) | |
{ | |
System.out.println(Arrays.toString(RecursiveEnum.values())); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment