Created
September 24, 2010 10:54
-
-
Save frsyuki/595185 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 定義済みのクラス | |
public class MyClass { | |
public int mem1; | |
} | |
// いまの生成方法 | |
public class MyClass_$$_Enhanced extends MyClass implements MessagePackable { | |
public void messagePack(Packer pk) { | |
pk.packArray(1); | |
pk.pack(mem1); | |
} | |
} | |
// 両方に対応できる生成方法 | |
public class MyClass_$$_PackUnpacker implements XXX { | |
public final void pack(Packer pk, Object obj) { | |
MyClass ins = (MyClass)obj; | |
pk.packArray(1); | |
pk.packArray(ins.mem1); | |
} | |
} | |
public class MyClass_$$_Enhanced extends MyClass implements MessagePackable { | |
static private final MyClass_$$_PackUnpacker MessagePackPackUnpacker = new MyClass_$$_PackUnpacker(); | |
public void messagePack(Packer pk) { | |
MessagePackPackUnpacker.pack(pk, this); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment