Open GoogleCodeExporter opened 9 years ago
Here is my class that implements KVMSerializable.
public class MyCustomObject implements KvmSerializable {
public int ID;
public int UserID;
public String Name;
public MyCustomObject() { }
public String getName() { return Name; }
public int getID() { return ID; }
public int getUserID() { return UserID; }
public void setName(String name) { Name = name; }
public void setID(int ID) { ID = ID; }
public void setUserID(int userID) { UserID = userID; }
public Object getProperty(int index) {
switch (index) {
case 0: return ID;
case 1: return UserID;
case 2: return Name;
}
return null;
}
public void setProperty(int index, Object value) {
switch (index) {
case 0: ID = Integer.parseInt(value.toString()); break;
case 1: UserID = Integer.parseInt(value.toString()); break;
case 2: Name = value.toString(); break;
}
}
public int getPropertyCount() { return 3; }
public void getPropertyInfo(int index, Hashtable arg1, PropertyInfo info) {
switch (index) {
case 0:
info.type = PropertyInfo.INTEGER_CLASS;
info.name = "ID";
break;
case 1:
info.type = PropertyInfo.INTEGER_CLASS;
info.name = "UserID";
break;
case 2:
info.type = PropertyInfo.STRING_CLASS;
info.name = "Name";
break;
}
}
}
Original comment by combsmst...@gmail.com
on 8 Oct 2013 at 2:24
Original issue reported on code.google.com by
combsmst...@gmail.com
on 8 Oct 2013 at 2:20