code: public static int from(String state) {
          switch (state.toUpperCase()) {
              case ACTIVE:
                  return Bundle.ACTIVE;
              case INSTALLED:
                  return Bundle.INSTALLED;
              case RESOLVED:
                  return Bundle.RESOLVED;
              case STARTING:
                  return Bundle.STARTING;
              case STOPPING:
                  return Bundle.STOPPING;
              case UNINSTALLED:
                  return Bundle.UNINSTALLED;
              default:
                  return -1; // Unknown.
          }
      }
docs: Gets the OSGi state from the string form.
  
  @param state the state as String
  @return the OSGi bundle state