code: @Override
      public int getPort() {
          if (this.port == null) {
              return -1;
          }
  
          try {
              return this.port.parseToInt();
          } catch (final NumberFormatException e) {
              // all of this should already have
              // been checked so should be impossible
              throw new RuntimeException(
                      "The port could not be parsed as an integer. This should not be possible. The port was "
                              + this.port);
          } catch (final IOException e) {
              throw new RuntimeException("IOException while extracting out the port. This should not be possible.");
          }
      }
docs: {@inheritDoc}