public class Action extends Object
| Modifier and Type | Field and Description |
|---|---|
private Commodity |
commodity
The commodity associated with the action.
|
private double |
latitude
The latitude the action occurs at.
|
private static org.slf4j.Logger |
logger |
private double |
longitude
The longitude the action occurs at.
|
private ActionStatus |
status
Represents the type of action to occur at that location.
|
| Modifier | Constructor and Description |
|---|---|
protected |
Action(JsonObject actionJson,
PathfinderServices services)
Constructs an Action with a JSON object that represents an Action.
|
| Modifier and Type | Method and Description |
|---|---|
Commodity |
getCommodity()
Returns the commodity associated with this action.
|
private static Commodity |
getCommodity(JsonObject json,
PathfinderServices services)
Returns the commodity of an action in the form a JSON object.
|
double |
getLatitude()
The latitude that the action occurs at.
|
private static double |
getLatitude(JsonObject json)
Returns the latitude of an action in the form a JSON object.
|
double |
getLongitude()
The longitude that the action occurs at.
|
private static double |
getLongitude(JsonObject json)
Returns the longitude of an action in the form a JSON object.
|
ActionStatus |
getStatus()
Returns the status of the action.
|
private static ActionStatus |
getStatus(JsonObject json)
Returns the status of an action in the form a JSON object.
|
private static ActionStatus |
getStatus(String status)
Returns the status of an action in the form of a string.
|
String |
toString() |
private static final org.slf4j.Logger logger
private final ActionStatus status
private final double latitude
private final double longitude
private final Commodity commodity
protected Action(JsonObject actionJson, PathfinderServices services)
actionJson - JSON object that represents an Action.services - a pathfinder services object.public ActionStatus getStatus()
public double getLatitude()
public double getLongitude()
public Commodity getCommodity()
private static ActionStatus getStatus(JsonObject json)
json - a JSON object that represents an action.private static ActionStatus getStatus(String status)
status - a string with the status of the actionprivate static double getLatitude(JsonObject json)
json - a JSON object that represents an action.private static double getLongitude(JsonObject json)
json - a JSON object that represents an action.private static Commodity getCommodity(JsonObject json, PathfinderServices services)
json - a JSON object that represents an action.services - a pathfinder services object.