com.kuka.resource
Interface IResource


public interface IResource

Base interface representing a resource.

A resource is a logical component of the system that is described by a unique name and by its capabilities. The capabilities represent what this resource can do and are fixed during runtime.

A logical component should be modeled as a separate resource X if one of the following statements apply:

  • X can be attached to the resource Y (i.e. "The gripper can be attached to the robot.")
  • A resource Y uses X (i.e. "The resource CarryPro uses a database."

    See Also:
    Object

    Method Summary
     Map<Class<?>,Object> getCapabilities()
              Returns all capabilities of the resource.
    <T> T
    getCapability(Class<T> capability)
              Returns the capability of this resource that is an instance of the given class.
     String getName()
              Returns the unique name of this resource.
     boolean hasCapability(Class<?> capability)
              Checks if the resource has the given capability.
     

    Method Detail

    getCapabilities

    Map<Class<?>,Object> getCapabilities()
    Returns all capabilities of the resource.

    Returns:
    a map containing the type and the instance of every capability of this resource

    hasCapability

    boolean hasCapability(Class<?> capability)
    Checks if the resource has the given capability.

    Parameters:
    capability - a capability class
    Returns:
    true if the resource has the given capability, false otherwise

    getCapability

    <T> T getCapability(Class<T> capability)
    Returns the capability of this resource that is an instance of the given class. A CapabilityNotAvailableException is thrown when the resource does not have such a capability.

    Type Parameters:
    T - type of the returned capability
    Parameters:
    capability - a capability class
    Returns:
    a capability of this resource that is of the given class
    Throws:
    CapabilityNotAvailableException

    getName

    String getName()
    Returns the unique name of this resource.

    Returns:
    the unique name of this resource.


    Copyright © 2019. All rights reserved.