Code example for EnumHashBiMap

Methods: put

0
        bean.hashBiMap.put( "one", 1 );
 
        bean.biMap = bean.hashBiMap;
 
        bean.enumHashBiMap = EnumHashBiMap.create( AlphaEnum.class );
        bean.enumHashBiMap.put( AlphaEnum.A, 1 );
        bean.enumHashBiMap.put( AlphaEnum.D, 4 );
        bean.enumHashBiMap.put( AlphaEnum.C, 3 );
        bean.enumHashBiMap.put( AlphaEnum.B, 2 );
 
        bean.enumBiMap = EnumBiMap.create( AlphaEnum.class, NumericEnum.class );
        bean.enumBiMap.put( AlphaEnum.A, NumericEnum.ONE );
        bean.enumBiMap.put( AlphaEnum.D, NumericEnum.FOUR );
        bean.enumBiMap.put( AlphaEnum.C, NumericEnum.THREE );
        bean.enumBiMap.put( AlphaEnum.B, NumericEnum.TWO );
 
        String expected = "{" +
                "\"biMap\":{\"one\":1}," + 
                "\"hashBiMap\":{\"one\":1}," + 
                "\"enumHashBiMap\":{\"A\":1,\"B\":2,\"C\":3,\"D\":4}," +