19 package org.sleuthkit.datamodel.blackboardutils.attributes;
21 import com.google.gson.Gson;
22 import com.google.gson.annotations.SerializedName;
23 import java.util.ArrayList;
24 import java.util.Iterator;
25 import java.util.List;
47 throw new IllegalArgumentException(
"toAttribute was pass a null list");
58 if (attribute == null) {
59 throw new IllegalArgumentException(
"fromAttribute was pass a null list");
64 throw new IllegalArgumentException(String.format(
"Invalid attribute of type %s passed to fromAttribute method. Attribute of type TSK_GEO_WAYPOINTS is required", type.getDisplayName()));
78 if (json == null || json.isEmpty()) {
92 private static String toJSON(GeoWaypointList waypoints) {
93 Gson gson =
new Gson();
94 return gson.toJson(waypoints);
102 public static final class GeoWaypointList implements Iterable<GeoWaypointList.GeoWaypoint> {
104 private final List<GeoWaypoint> points;
110 points =
new ArrayList<>();
119 if (wayPoint == null) {
120 throw new IllegalArgumentException(
"addPoint was passed a null waypoint");
123 points.add(wayPoint);
132 return points.isEmpty();
137 return points.iterator();
147 @SerializedName(
"TSK_GEO_LATITUDE")
148 private final Double latitude;
149 @SerializedName(
"TSK_GEO_LONGITUDE")
150 private final Double longitude;
151 @SerializedName(
"TSK_GEO_ALTITUDE")
152 private final Double altitude;
153 @SerializedName(
"TSK_NAME")
154 private final String name;
166 public GeoWaypoint(Double latitude, Double longitude, Double altitude, String name) {
167 if (latitude == null) {
168 throw new IllegalArgumentException(
"Constructor was passed null latitude");
171 if (longitude == null) {
172 throw new IllegalArgumentException(
"Constructor was passed null longitude");
175 this.latitude = latitude;
176 this.longitude = longitude;
177 this.altitude = altitude;
static ATTRIBUTE_TYPE fromID(int typeID)
void addPoint(GeoWaypoint wayPoint)
GeoWaypointList fromAttribute(BlackboardAttribute attribute)
Iterator< GeoWaypointList.GeoWaypoint > iterator()
BlackboardAttribute.Type getAttributeType()
GeoWaypoint(Double latitude, Double longitude, Double altitude, String name)
BlackboardAttribute toAttribute(String moduleName, GeoWaypointList value)