Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save frsyuki/ffd5450f86ad0b6ebb54 to your computer and use it in GitHub Desktop.
Save frsyuki/ffd5450f86ad0b6ebb54 to your computer and use it in GitHub Desktop.
@MessagePackDeserialzeTypeSwitches({
@MessagePackTypeSwitches.ifEquals(key = "type", value = "output", then = OutputNode.class),
@MessagePackTypeSwitches.ifEquals(key = "type", value = "project", then = ProjectNode.class),
@MessagePackTypeSwitches.ifEquals(key = "type", value = "tablescan", then = TableScanNode.class),
@MessagePackTypeSwitches.ifExists(key = "error", then = ErrorNode.class)
@MessagePackTypeSwitches.ifExists(key = "engine", then = EngineNode.class)
})
public abstract class PlanNode
{
...
}
public class ErrorNode extends PlanNode
{
@JsonProperty("error")
private String getError() { ... }
}
public class EngineNode extends PlanNode
{
@JsonProperty("engine")
private String getEngine() { ... }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment