EnumMarshaller implements DynamoDBMarshaller<Enum> { @Override public Enum unmarshall(Class clazz, String obj) { if (obj == null) { return null; } return Enum.valueOf(clazz, obj); }  @Override String marshall(Enum getterReturnResult); @Override Enum unmarshall(Class clazz, String obj);  }
@Test public void unmarshall() throws Exception { EnumMarshaller m = new EnumMarshaller(); Assert.assertEquals(TestEnum.EnumValue1, m.unmarshall(TestEnum.class, TestEnum.EnumValue1.toString())); Assert.assertEquals(TestEnum.ENUMVALUE2, m.unmarshall(TestEnum.class, TestEnum.ENUMVALUE2.toString())); }
@Test public void unmarshallNull() throws Exception { EnumMarshaller m = new EnumMarshaller(); Assert.assertNull(m.unmarshall(TestEnum.class, null)); }