我有一个 A 类,其中包含以下内容
class A
{
private HashSet<Long> at = new HashSet<Long>();
它有一个像这样的构造函数
A()
{
//set is being initialsised here
this.at.add(new Long(44));
this.at.add(new Long(34));
this.at.add(new Long(54));
this.at.add(new Long(55));
}
现在请告诉我如何通过Spring初始化这个Long类型的哈希集,,
我努力了 ...
<property name="at">
<util:set set-class="java.util.HashSet">
<value>45</value>
<value>65</value>
<value>87</value>
</util:set>
</property>