public static TunnelRequestType parseType(String type) {

        // Locate type with given parameter value
        for (TunnelRequestType possibleType : values()) {
            if (type.equals(possibleType.PARAMETER_VALUE))
                return possibleType;
        }

        // No such type
        return null;

    }
Parses the given tunnel request type string, returning the
TunnelRequestType which matches that string, as declared by
{@link #PARAMETER_VALUE}. If no such type exists, null is returned.

@param type
    The type string to parse.

@return
    The TunnelRequestType which specifies the given string as its
    {@link #PARAMETER_VALUE}, or null if no such type exists.
guacamole/src/main/java/org/apache/guacamole/tunnel/TunnelRequestType.java