Created
July 5, 2011 05:51
-
-
Save todesking/1064305 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
public enum NamedParam { | |
A(new Param1(1), new Param2("hoge")), B(new Param1(10), new Param2("fuga")); | |
X(Param1 p1, Param2 p2) { | |
this.p1 = p1.value; | |
this.p2 = p2.value; | |
} | |
public final int p1; | |
public final String p2; | |
protected static class Value<T> { | |
public Value(T value) { | |
this.value = value; | |
} | |
public final T value; | |
} | |
protected static class Param1 extends Value<Integer> { | |
public Param1(int x) { | |
super(x); | |
} | |
} | |
protected static class Param2 extends Value<String> { | |
public Param2(String x) { | |
super(x); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment