public static EnumSample valueOf(int number)
        {
            switch (number)
            {
                case 0:
                    return TYPE0;
                case 1:
                    return TYPE1;
                case 2:
                    return TYPE2;
                case 3:
                    return TYPE3;
                case 4:
                    return TYPE4;
            }
            return null;
        }
Foo - for testing

@author David Yu
@created Nov 10, 2009
protostuff-core/src/test/java/io/protostuff/Foo.java