Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for getActualKeyClassOfMap (0.12 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 Nov 01 20:58:10 UTC 2024
    - Last Modified: Thu Mar 07 01:59:08 UTC 2024
    - 11.5K bytes
    - Viewed (0)
  2. src/main/java/org/codelibs/core/lang/GenericsUtil.java

         *            パラメータ化された{@link Map}
         * @param map
         *            パラメータ化された型が持つ型変数をキー、型引数を値とする{@link Map}
         * @return パラメータ化された{@link 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 Nov 01 20:58:10 UTC 2024
    - Last Modified: Thu Mar 07 01:59:08 UTC 2024
    - 23.6K bytes
    - Viewed (0)
Back to top