public void handlePinEvent(PinEvent event) {
// only process listeners and triggers if the received interrupt event
// matches the pin number being tracked my this class instance
if (this.pin.getPin().equals(event.getPin())) {
if (event.getEventType() == PinEventType.DIGITAL_STATE_CHANGE) {
PinState state = ((PinDigitalStateChangeEvent)event).getState();
// process event callbacks for digital listeners
for (GpioPinListener listener : pin.getListeners()) {
if (listener instanceof GpioPinListenerDigital) {
((GpioPinListenerDigital)listener).handleGpioPinDigitalStateChangeEvent(new GpioPinDigitalStateChangeEvent(event.getSource(), pin, state));