code: public int getPollingPeriod(final String polledObject) throws DevFailed {
          try {
              return AttributeGetterSetter.getAttribute(polledObject, device.getAttributeList()).getPollingPeriod();
          } catch (final DevFailed e) {
              return device.getCommand(polledObject).getPollingPeriod();
          }
      }
docs: Get polling period of an attribute or a command
  
  @param polledObject The name of the polled object (attribute or command)
  @return The polling period
  @throws DevFailed