public abstract class FixtureTemplateSubTypeHandler extends Object
FixtureMap, FixtureList and FixtureValue as a subtype.
For parsing FixtureTemplate in many ways, checking type (like `instanceof`) is used so often. But, It has risks about missing some subtype of FixtureTemplate.
So, for avoiding conditional(if/else things) logic, using abstract class is recommended.| Constructor and Description |
|---|
FixtureTemplateSubTypeHandler() |
| Modifier and Type | Method and Description |
|---|---|
void |
handle(FixtureTemplate fixtureTemplate)
Handle FixtureTemplate depends on a it's subtype
|
protected abstract void |
handleIf(FixtureList fixtureList)
Handle if FixtureTemplate is a FixtureList
|
protected abstract void |
handleIf(FixtureMap fixtureMap)
Handle if FixtureTemplate is a FixtureMap
|
protected abstract void |
handleIf(FixtureValue fixtureValue)
Handle if FixtureTemplate is a FixtureValue
|
public void handle(FixtureTemplate fixtureTemplate)
protected abstract void handleIf(FixtureMap fixtureMap)
protected abstract void handleIf(FixtureList fixtureList)
protected abstract void handleIf(FixtureValue fixtureValue)
Copyright © 2018. All rights reserved.