use of me.retrodaredevil.solarthing.packets.identification.Identifier in project solarthing by wildmountainfarms.
the class PointUtil method getTags.
public static Map<String, String> getTags(Packet packet) {
Map<String, String> r = new HashMap<>();
if (packet instanceof Identifiable) {
Identifier identifier = ((Identifiable) packet).getIdentifier();
r.put("identifier", identifier.getRepresentation());
if (identifier instanceof SupplementaryIdentifier) {
SupplementaryIdentifier supplementaryIdentifier = (SupplementaryIdentifier) identifier;
r.put("identifier_supplementaryTo", supplementaryIdentifier.getSupplementaryTo().getRepresentation());
}
}
if (packet instanceof DocumentedPacket) {
DocumentedPacket documentedPacket = (DocumentedPacket) packet;
DocumentedPacketType type = documentedPacket.getPacketType();
r.put("packetType", type.toString());
}
return r;
}
Aggregations