public static Map<DecodeHintType, Object> parseDecodeHints(Intent intent) {
        Bundle extras = intent.getExtras();
        if (extras == null || extras.isEmpty()) {
            return null;
        }
        Map<DecodeHintType, Object> hints = new EnumMap<>(DecodeHintType.class);

        for (DecodeHintType hintType : DecodeHintType.values()) {

            if (hintType == DecodeHintType.CHARACTER_SET ||
                    hintType == DecodeHintType.NEED_RESULT_POINT_CALLBACK ||
                    hintType == DecodeHintType.POSSIBLE_FORMATS) {
                continue; // This hint is specified in another way
            }

            String hintName = hintType.name();
            if (extras.containsKey(hintName)) {
                if (hintType.getValueType().equals(Void.class)) {
                    // Void hints are just flags: use the constant specified by the DecodeHintType
                    hints.put(hintType, Boolean.TRUE);
                } else {
                    Object hintData = extras.get(hintName);
                    if (hintType.getValueType().isInstance(hintData)) {
                        hints.put(hintType, hintData);
                    } else {
                        Log.w(TAG, "Ignoring hint " + hintType + " because it is not assignable from " + hintData);
                    }
                }
            }
        }

        Log.i(TAG, "Hints from the Intent: " + hints);
        return hints;
    }
<p>Split a query string into a list of name-value pairs.</p>

<p>This is an alternative to the {@link Uri#getQueryParameterNames()} and
{@link Uri#getQueryParameters(String)}, which are quirky and not suitable
for exist-only Uri parameters.</p>

<p>This method ignores multiple parameters with the same name and returns the
first one only. This is technically incorrect, but should be acceptable due
to the method of processing Hints: no multiple values for a hint.</p>

@param query query to split
@return name-value pairs
zxing-android-embedded/src/com/google/zxing/client/android/DecodeHintManager.java