Last active
August 29, 2015 14:24
-
-
Save frsyuki/cfe868385d853a3995e1 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
@MessagePackPolimorhpicType("type") | |
public abstract class PlanNode | |
{ | |
... | |
public static final Deserializer type = new PolymorphicDeserializer() | |
.add("error", ErrorNode.class) | |
.add("engine", EngineNode.class); | |
} | |
public class ErrorNode extends PlanNode | |
{ | |
} | |
public class EngineNode extends PlanNode | |
{ | |
} | |
public class MyCustomNode extends PlanNode | |
{ | |
static { | |
PlanNode.type.add("my_custom", MyCustomNode.class); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment