public class DefaultDriverHandler extends java.lang.Object implements DriverHandler
Modifier and Type | Field and Description |
---|---|
protected static ServiceDirectory |
serviceDirectory |
Constructor and Description |
---|
DefaultDriverHandler(DriverData data)
Creates new driver handler with the attached driver data.
|
Modifier and Type | Method and Description |
---|---|
<T extends Behaviour> |
behaviour(java.lang.Class<T> behaviourClass)
Returns the specified facet of behaviour to interact with the device.
|
DriverData |
data()
Returns the device driver data.
|
Driver |
driver()
Returns the parent device driver.
|
<T> T |
get(java.lang.Class<T> serviceClass)
Returns the reference to the implementation of the specified service.
|
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
hasBehaviour
protected static ServiceDirectory serviceDirectory
public DefaultDriverHandler(DriverData data)
data
- driver data to attachpublic Driver driver()
DriverHandler
driver
in interface DriverHandler
public DriverData data()
DriverHandler
data
in interface DriverHandler
public <T extends Behaviour> T behaviour(java.lang.Class<T> behaviourClass)
DriverHandler
behaviour
in interface DriverHandler
T
- type of behaviourbehaviourClass
- behaviour classpublic <T> T get(java.lang.Class<T> serviceClass)
DriverHandler
get
in interface DriverHandler
T
- type of serviceserviceClass
- service classpublic java.lang.String toString()
toString
in class java.lang.Object