public static Response fromString(final String text) {
      if (text != null) {
        for (Response response : Response.values()) {
          // If the whole string matches, or the input is only 1 character and it matches the
          // first character of the response text, then they are considered equal.
          if (text.equalsIgnoreCase(response.text)
              || ((text.length() == 1 && text.equalsIgnoreCase(response.text.substring(0, 1))))) {
            return response;
          }
        }
      }
      return null;
    }
Semi-complete implementation of {@link CliAroundInterceptor} for convenience for implementors.


@since GemFire 7.0
geode-gfsh/src/main/java/org/apache/geode/management/internal/cli/AbstractCliAroundInterceptor.java