Code example for HashBiMap

Methods: put

0
    public void testSerialization() { 
        BeanWithBiMapTypes bean = new BeanWithBiMapTypes();
 
        bean.hashBiMap = HashBiMap.create();
        // only one value since it is not sorted 
        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 );