Override the Object's default toString() method
This commit is contained in:
parent
b550fd73d2
commit
96dc3705c1
|
@ -248,6 +248,17 @@ public final class SerialPort
|
|||
return !canonicalFile.getCanonicalFile().equals(canonicalFile.getAbsoluteFile());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the same output as calling {@link #getPortDescription()}. This may be useful for display containers which call a Java Object's default toString() method.
|
||||
*
|
||||
* @return The port description as reported by the device itself.
|
||||
*/
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return getPortDescription();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of all available serial ports on this machine.
|
||||
* <p>
|
||||
|
|
Loading…
Reference in New Issue