@SuppressWarnings("unused")
    @UsedByGeneratedCode
    public static Map<String, Object> internMapOf(Object... values) {
        if (values == null || values.length == 0) {
            return Collections.emptyMap();
        }
        int len = values.length;
        if (len % 2 != 0) {
            throw new IllegalArgumentException("Number of arguments should be an even number representing the keys and values");
        }

        // if the length is 2 then only a single annotation is defined, so tried use internal pool
        if (len == 2) {
            Object value = values[1];
            if (value == Collections.EMPTY_MAP) {
                String key = values[0].toString().intern();
                return INTERN_MAP_POOL.computeIfAbsent(key, s ->
                        Collections.singletonMap(s, Collections.emptyMap())
                );
            } else {
                return StringUtils.internMapOf(values);
            }

        } else {
            return StringUtils.internMapOf(values);
        }
    }
@ SuppressWarnings ( "unused" ) @ UsedByGeneratedCode public static Map < String , Object > internMapOf ( Object ... values ) { if ( values == null || values . length == 0 ) { return Collections . emptyMap ( ) ; } int len = values . length ; if ( len % 2 != 0 ) { throw new IllegalArgumentException ( "Number of arguments should be an even number representing the keys and values" ) ; } if ( len == 2 ) { Object value = values [ 1 ] ; if ( value == Collections . EMPTY_MAP ) { String key = values [ 0 ] . toString ( ) . intern ( ) ; return INTERN_MAP_POOL . computeIfAbsent ( key , s -> Collections . singletonMap ( s , Collections . emptyMap ( ) ) ) ; } else { return StringUtils . internMapOf ( values ) ; } } else { return StringUtils . internMapOf ( values ) ; } }
Converts the given objects into a map of interned strings where the keys and values are alternating entries in the passed array. See {@link String#intern()}.

<p>The values stored at even number positions will be converted to strings and interned.</p>

@param values The objects
@return An unmodifiable set of strings
@see io.micronaut.core.util.CollectionUtils#mapOf(Object...)