【发布时间】:2012-10-22 12:30:40
【问题描述】:
我们正在使用 AutoBeans 创建 Pojo 对象以用于 RPC-Calls。 Pojo 具有默认值或其他类初始化的推荐方法是什么?
例如
public interface SamplePojo {
// should default to 5
int getSampleProperty();
void setSampleProperty(int sampleProperty);
}
public interface ModelFactory extends AutoBeanFactory {
AutoBean<SamplePojo> getSamplePojo();
}
SamplePojo 有一个我们总是希望默认为 5 的 int 属性。
【问题讨论】: