XStream serialize null values

前端 未结 3 528
再見小時候
再見小時候 2021-01-18 05:38

Suppose I have

class Student
{
String name;
int    age;
String teacher;
}

Then :

public class App1
{
    public static voi         


        
3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-18 05:55

    You can put a empty String

    String teacher = "";
    

    Or optimized one :)

    String teacher = StringUtils.EMPTY;
    

提交回复
热议问题