public class AreaInstruction extends Instruction<AreaInstruction>
In its minimal form it consists of a position, defines if it refers to entering or leaving, and one of area type and area name.
Exemplary EBNF of how this instruction can be transformed into human-readable text and what's mandatory / optional. Elements ending with STRING are terminal (not defined any further).
AREA_INSTRUCTION = ENTER | EXIT;
ENTER = "Cross", AREA, [TOWARDS];
TOWARDS = towards [EXIT_LANDMARK_STRING] and [EXIT_STREET_NAME_STRING];
EXIT = "Now you leave", AREA;
AREA = [AREA_TYPE_STRING], [AREA_NAME_STRING]; (* at least one of the two *)
| Modifier and Type | Class and Description |
|---|---|
static class |
AreaInstruction.SubType |
| Constructor and Description |
|---|
AreaInstruction() |
| Modifier and Type | Method and Description |
|---|---|
static AreaInstruction |
createMinimalEnter(GeoJSONCoordinate position)
Note, that one of
setAreaName(String) or
#setAreaType(Area) is mandatory as well |
static AreaInstruction |
createMinimalExit(GeoJSONCoordinate position)
Note, that one of
setAreaName(String) or
#setAreaType(Area) is mandatory as well |
boolean |
equals(Object obj) |
Optional<String> |
getAreaName() |
Optional<Constants.Area> |
getAreaType() |
Optional<Landmark> |
getExitLandmark() |
Optional<String> |
getExitStreetName() |
AreaInstruction.SubType |
getSubType() |
int |
hashCode() |
AreaInstruction |
setAreaName(String areaName) |
AreaInstruction |
setAreaType(Constants.Area areaType) |
AreaInstruction |
setExitLandmark(Landmark exitLandmark) |
AreaInstruction |
setExitStreetName(String exitStreetName) |
AreaInstruction |
setSubType(AreaInstruction.SubType subType) |
String |
toString() |
void |
validate()
Checks if the instance is in a valid / useful state.
|
getAdditionalInfo, getConfirmationTriggerPosition, getPosition, getPreviewTriggerPosition, getText, setAdditionalInfo, setConfirmationTriggerPosition, setConfirmationTriggerPosition, setPosition, setPosition, setPreviewTriggerPosition, setPreviewTriggerPosition, setTextpublic AreaInstruction.SubType getSubType()
public Optional<Constants.Area> getAreaType()
public AreaInstruction setSubType(AreaInstruction.SubType subType)
public AreaInstruction setAreaName(String areaName)
public AreaInstruction setAreaType(Constants.Area areaType)
public AreaInstruction setExitStreetName(String exitStreetName)
public AreaInstruction setExitLandmark(Landmark exitLandmark)
public static AreaInstruction createMinimalEnter(GeoJSONCoordinate position)
setAreaName(String) or
#setAreaType(Area) is mandatory as wellpublic static AreaInstruction createMinimalExit(GeoJSONCoordinate position)
setAreaName(String) or
#setAreaType(Area) is mandatory as wellpublic void validate()
ValidatableIllegalArgumentException including a description of the
invalid state is thrown.validate in interface Validatablevalidate in class Instruction<AreaInstruction>public int hashCode()
hashCode in class Instruction<AreaInstruction>public boolean equals(Object obj)
equals in class Instruction<AreaInstruction>public String toString()
toString in class Instruction<AreaInstruction>Copyright © 2018. All rights reserved.