public class KnownDeviceID
extends java.lang.Object
Constructor and Description |
---|
KnownDeviceID()
Create a representation of how this device will be displayed with a default values
|
KnownDeviceID(int device_id,
java.lang.String friendly_name)
Create a representation of how this device will be displayed
|
KnownDeviceID(java.lang.String hostname,
int device_id,
java.lang.String friendly_name)
Create a representation of how this device will be displayed
|
Modifier and Type | Method and Description |
---|---|
int |
getConnectToServerPort()
Return the TCP port we are on and others need to connect to
|
int |
getDeviceId() |
java.lang.String |
getFriendlyName() |
java.lang.String |
getHostName() |
java.lang.String |
getSaveLine()
Get the line of text we need to save this device to a known config file
|
static KnownDeviceID |
restore(java.lang.String restore_line)
Create a KnownDeviceId based on the line of text to restore.
|
void |
setConnectToServerPort(int connectToServerPort)
Set the value after operating system has given us the port
|
void |
setDeviceId(int deviceId) |
void |
setFriendlyName(java.lang.String friendlyName) |
public KnownDeviceID(java.lang.String hostname, int device_id, java.lang.String friendly_name)
hostname
- The hostname of devicedevice_id
- the integer device IDfriendly_name
- the friendly name for the devicepublic KnownDeviceID(int device_id, java.lang.String friendly_name)
device_id
- the integer device IDfriendly_name
- the friendly name for the devicepublic KnownDeviceID()
public java.lang.String getHostName()
public int getConnectToServerPort()
public void setConnectToServerPort(int connectToServerPort)
connectToServerPort
- the Port we need to connect to TCP serverpublic int getDeviceId()
public void setDeviceId(int deviceId)
public java.lang.String getFriendlyName()
public void setFriendlyName(java.lang.String friendlyName)
public static KnownDeviceID restore(java.lang.String restore_line)
restore_line
- the space delimited line fof text. May look like "hb-001d43201188 1 Dancer_1"public java.lang.String getSaveLine()