The google protocol buffer design fits most of your requirements. other than the LinkedList data structure in field3, but since gpb has kept the order of duplicate values, I think this is enough for you.
Protocol buffers are a way of encoding structured data in an efficient but extensible format. Google uses protocol buffers for almost all of its internal RPC protocols and file formats.
step 1, install gpb from http://code.google.com/apis/protocolbuffers/ , read the docs.
step 2, define your message. proto:
message UserDetail { required string id = 1; optional string nick = 2; repeated double money = 3; }
step 3, use protoc compile.proto and create the file UserDetail.java.
... public interface UserDetailOrBuilder extends com.google.protobuf.MessageOrBuilder {
step 4, a simple call
UserDetail.parseFrom(input); User.UserDetail t.writeTo(output);
gpb has a different language addon, check out http://code.google.com/p/protobuf/wiki/ThirdPartyAddOns
source share