Package com.google.web.bindery.autobean.shared.impl

Examples of com.google.web.bindery.autobean.shared.impl.EnumMap


    assertNotNull(decodedBean.as().getList());
    assertTrue(decodedBean.as().getList().isEmpty());
  }

  public void testEnum() {
    EnumMap map = (EnumMap) f;
    assertEquals("BAR", map.getToken(MyEnum.BAR));
    assertEquals("quux", map.getToken(MyEnum.BAZ));
    assertEquals(MyEnum.BAR, map.getEnum(MyEnum.class, "BAR"));
    assertEquals(MyEnum.BAZ, map.getEnum(MyEnum.class, "quux"));

    List<MyEnum> arrayValue = Arrays.asList(MyEnum.FOO, MyEnum.BAR, null, MyEnum.BAZ);
    Map<MyEnum, Integer> mapValue = new HashMap<MyEnum, Integer>();
    mapValue.put(MyEnum.FOO, 0);
    mapValue.put(MyEnum.BAR, 1);
View Full Code Here


  /**
   * Ensures that enum types that are reachable only through a method
   * parameterization are included in the enum map.
   */
  public void testEnumReachableOnlyThroughParameterization() {
    EnumMap map = (EnumMap) f;
    assertEquals("FOO_LIST", map.getToken(EnumReachableThroughList.FOO_LIST));
    assertEquals("FOO_KEY", map.getToken(EnumReachableThroughMapKey.FOO_KEY));
    assertEquals("FOO_VALUE", map.getToken(EnumReachableThroughMapValue.FOO_VALUE));
    assertEquals(EnumReachableThroughList.FOO_LIST, map.getEnum(EnumReachableThroughList.class,
        "FOO_LIST"));
    assertEquals(EnumReachableThroughMapKey.FOO_KEY, map.getEnum(EnumReachableThroughMapKey.class,
        "FOO_KEY"));
    assertEquals(EnumReachableThroughMapValue.FOO_VALUE, map.getEnum(
        EnumReachableThroughMapValue.class, "FOO_VALUE"));
  }
View Full Code Here

TOP

Related Classes of com.google.web.bindery.autobean.shared.impl.EnumMap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.