code: public Consumer createConsumer(Processor processor) throws Exception {
          LOG.debug(this.toString());
  
          ObjectHelper.notNull(this.mode, "mode");
          GpioPin pin = isAlreadyProvisioned();
  
          if (pin == null) {
              switch (this.mode) {
              case DIGITAL_INPUT:
                  pin = getOrCreateController().provisionDigitalInputPin(getPin(), pullResistance);
                  break;
              case ANALOG_INPUT:
                  pin = getOrCreateController().provisionAnalogInputPin(getPin());
                  break;
              case ANALOG_OUTPUT:
              case DIGITAL_OUTPUT: // PinMode.allOutput()
              case PWM_OUTPUT:
                  LOG.error("Cannot create Consumer with OUTPUT Mode");
                  return null;
              default:
                  LOG.error("Cannot create Consumer w/o Mode");
                  break;
              }
  
          } else {
              // enhancement we could manage several pins with one consumer
              throw new IllegalArgumentException("Cannot create twice same input pin [" + this.gpioId + "] for Consumer");
          }
  
          return new GPIOConsumer(this, processor, pin, state);
      }
docs: Create consumer map to an Input PIN