public class ScannedDevices
extends java.lang.Object
ScannedDevices
is a simple distinguished kind of map of serial numbers
to device types. Simple serialization and deserialization logic is provided.Modifier and Type | Class and Description |
---|---|
protected static class |
ScannedDevices.MapAdapter
There *has* to be an easier way here, somehow.
|
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
errorMessage |
protected java.lang.Object |
lock |
protected java.util.Map<SerialNumber,DeviceManager.UsbDeviceType> |
map |
static java.lang.String |
TAG |
Constructor and Description |
---|
ScannedDevices() |
ScannedDevices(ScannedDevices them) |
Modifier and Type | Method and Description |
---|---|
boolean |
containsKey(SerialNumber serialNumber) |
java.util.Set<java.util.Map.Entry<SerialNumber,DeviceManager.UsbDeviceType>> |
entrySet() |
static ScannedDevices |
fromSerializationString(java.lang.String string) |
DeviceManager.UsbDeviceType |
get(SerialNumber serialNumber) |
java.lang.String |
getErrorMessage() |
java.util.Set<SerialNumber> |
keySet() |
protected static Gson |
newGson() |
DeviceManager.UsbDeviceType |
put(SerialNumber serialNumber,
DeviceManager.UsbDeviceType deviceType) |
DeviceManager.UsbDeviceType |
remove(SerialNumber serialNumber) |
void |
setErrorMessage(java.lang.String errorMessage) |
int |
size() |
java.lang.String |
toSerializationString() |
public static final java.lang.String TAG
protected final java.lang.Object lock
protected java.lang.String errorMessage
protected java.util.Map<SerialNumber,DeviceManager.UsbDeviceType> map
public ScannedDevices(ScannedDevices them)
public ScannedDevices()
public void setErrorMessage(java.lang.String errorMessage)
public java.lang.String getErrorMessage()
public int size()
public DeviceManager.UsbDeviceType put(SerialNumber serialNumber, DeviceManager.UsbDeviceType deviceType)
public DeviceManager.UsbDeviceType get(SerialNumber serialNumber)
public boolean containsKey(SerialNumber serialNumber)
public java.util.Set<SerialNumber> keySet()
public java.util.Set<java.util.Map.Entry<SerialNumber,DeviceManager.UsbDeviceType>> entrySet()
public DeviceManager.UsbDeviceType remove(SerialNumber serialNumber)
protected static Gson newGson()
public java.lang.String toSerializationString()
public static ScannedDevices fromSerializationString(java.lang.String string)