com.asprise.imaging.scan

## Class DeviceItem

- java.lang.Object
- - com.asprise.imaging.scan.DeviceItem

- All Implemented Interfaces:
    Closeable, AutoCloseable
  Direct Known Subclasses:
    Device, FunctionalUnit

      public abstract class DeviceItem
      extends Object
      implements Closeable

  Represents a device or a functional unit.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Closes it children.
    `List<Capability>` | `getCapabilities()` List of capabilities
    `Capability` | `getCapability(long id)` Returns the capability with the given id or null if not found.
    `Long` | `getCapabilityCurrentValueAsLong(long id)` Returns the current value as long of the capability with the given id or null if it does not exist
    `String` | `getCapabilityCurrentValueAsString(long id)` Returns the current value as string of the capability with the given id or null if it does not exist
    `Object` | `getCapabilityValue(long capId)`
    `Long` | `getCapabilityValueAsLong(long id)` Returns the new value if it has been set otherwise the current value.
    `String` | `getCapabilityValueAsString(long id)` Returns the new value if it has been set otherwise the current value.
    `abstract String` | `getDescription()` Description (optional)
    `abstract String` | `getId()` ID of device or functional unit
    `abstract String` | `getName()` Name (optional)
    `boolean` | `isCapabilityDirty()`
    `abstract List<Capability>` | `refreshCapabilities()` Refresh capabilities from the device.
    `void` | `setCapabilityDirty(boolean capabilityDirty)`
    `void` | `setCapabilityValue(long capId, Object value)`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### getId

          public abstract String getId()

      ID of device or functional unit

    - #### getName

          public abstract String getName()

      Name (optional)

    - #### getDescription

          public abstract String getDescription()

      Description (optional)

    - #### refreshCapabilities

          public abstract List<Capability> refreshCapabilities()
                                                        throws ScanException

      Refresh capabilities from the device.
      Returns:
        list of capabilities that changed
      Throws:
        `ScanException`

    - #### getCapabilities

          public List<Capability> getCapabilities()

      List of capabilities

    - #### getCapability

          public Capability getCapability(long id)

      Returns the capability with the given id or null if not found.
      Parameters:
        `id` - search id
      Returns:
        the capability with the given id or null if not found.

    - #### getCapabilityCurrentValueAsString

          public String getCapabilityCurrentValueAsString(long id)

      Returns the current value as string of the capability with the given id or null if it does not exist
      Parameters:
        `id` - capability id
      Returns:
        the current value as string of the capability with the given id or null if it does not exist

    - #### getCapabilityCurrentValueAsLong

          public Long getCapabilityCurrentValueAsLong(long id)

      Returns the current value as long of the capability with the given id or null if it does not exist
      Parameters:
        `id` - capability id
      Returns:
        the current value as long of the capability with the given id or null if it does not exist

    - #### getCapabilityValueAsString

          public String getCapabilityValueAsString(long id)

      Returns the new value if it has been set otherwise the current value.
      Parameters:
        `id` - capability id
      Returns:
        the new value if it has been set otherwise the current value.

    - #### getCapabilityValueAsLong

          public Long getCapabilityValueAsLong(long id)

      Returns the new value if it has been set otherwise the current value.
      Parameters:
        `id` - capability id
      Returns:
        the new value if it has been set otherwise the current value.

    - #### getCapabilityValue

          public Object getCapabilityValue(long capId)

    - #### setCapabilityValue

          public void setCapabilityValue(long capId,
                                Object value)

    - #### isCapabilityDirty

          public boolean isCapabilityDirty()

    - #### setCapabilityDirty

          public void setCapabilityDirty(boolean capabilityDirty)

    - #### close

          public void close()
                     throws IOException

      Closes it children.
      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      Throws:
        `IOException`

Copyright © Asprise Software. All Rights Reserved. Please visit the product page at asprise.com