use of me.retrodaredevil.solarthing.packets.identification.SupplementaryIdentifier in project solarthing by wildmountainfarms.
the class FXAccumulationDataCache method createFromIdentifier.
public static FXAccumulationDataCache createFromIdentifier(Identifier supplementaryIdentifier, Data mainData, Long firstDateMillis, Long lastDateMillis, Data unknownData, Long unknownStartDateMillis) {
if (!(supplementaryIdentifier instanceof SupplementaryIdentifier)) {
throw new IllegalArgumentException("The passed identifier is not a SupplementaryIdentifier! It is: " + supplementaryIdentifier.getClass() + " and its value is: " + supplementaryIdentifier.getRepresentation());
}
Identifier identifier = ((SupplementaryIdentifier) supplementaryIdentifier).getSupplementaryTo();
if (!(identifier instanceof OutbackIdentifier)) {
throw new IllegalArgumentException("identifier should be an OutbackIdentifier! It is: " + identifier.getClass() + " and its value is: " + identifier.getRepresentation());
}
OutbackIdentifier outbackIdentifier = (OutbackIdentifier) identifier;
return new FXAccumulationDataCache(outbackIdentifier.getAddress(), mainData, firstDateMillis, lastDateMillis, unknownData, unknownStartDateMillis);
}
use of me.retrodaredevil.solarthing.packets.identification.SupplementaryIdentifier 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