Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for getActualKeyClassOfMap (0.14 sec)

  1. src/test/java/org/codelibs/core/lang/GenericsUtilTest.java

            final Map<TypeVariable<?>, Type> map = GenericsUtil.getTypeVariableMap(Hoge.class);
            final Method method = Hoge.class.getMethod("map");
            assertThat(GenericsUtil.getActualKeyClassOfMap(method.getGenericReturnType(), map), is(sameClass(String.class)));
        }
    
        /**
         * @throws Exception
         */
        public void testGetActualValueClassOfMap() throws Exception {
    Registered: Fri Sep 05 20:58:11 UTC 2025
    - Last Modified: Sat May 10 01:32:17 UTC 2025
    - 11.5K bytes
    - Viewed (0)
  2. src/main/java/org/codelibs/core/lang/GenericsUtil.java

         * @param map
         *            the map that contains the type variables and type arguments
         * @return the actual key type of the map, or null if not a parameterized map
         */
        public static Class<?> getActualKeyClassOfMap(final Type type, final Map<TypeVariable<?>, Type> map) {
            if (!isTypeOf(type, Map.class)) {
                return null;
            }
            return getActualClass(getGenericParameter(type, 0), map);
        }
    
    Registered: Fri Sep 05 20:58:11 UTC 2025
    - Last Modified: Thu Jul 31 08:16:49 UTC 2025
    - 23.4K bytes
    - Viewed (0)
Back to top