@Test public void conversionToAndFromAddresses() { AddressGroup group = new AddressGroup(ImmutableSortedSet.of("1.1.1.1:255.255.255.1"), "ag1"); AddressGroupBean bean = new AddressGroupBean(group); assertThat(new AddressGroupBean(bean.toAddressGroup()), equalTo(bean)); }
public AddressGroup toAddressGroup() { return new AddressGroup( name, ImmutableSortedSet.copyOf(firstNonNull(addresses, ImmutableSet.of())), ImmutableSortedSet.copyOf(firstNonNull(childGroupNames, ImmutableSet.of()))); }
AddressGroupBean { public AddressGroup toAddressGroup() { return new AddressGroup( name, ImmutableSortedSet.copyOf(firstNonNull(addresses, ImmutableSet.of())), ImmutableSortedSet.copyOf(firstNonNull(childGroupNames, ImmutableSet.of()))); } }
AddressGroupBean { public AddressGroup toAddressGroup() { return new AddressGroup( name, ImmutableSortedSet.copyOf(firstNonNull(addresses, ImmutableSet.of())), ImmutableSortedSet.copyOf(firstNonNull(childGroupNames, ImmutableSet.of()))); } @JsonCreator private  AddressGroupBean();  AddressGroupBean(AddressGroup addressGroup); }
AddressGroupBean { public AddressGroup toAddressGroup() { return new AddressGroup( name, ImmutableSortedSet.copyOf(firstNonNull(addresses, ImmutableSet.of())), ImmutableSortedSet.copyOf(firstNonNull(childGroupNames, ImmutableSet.of()))); } @JsonCreator private  AddressGroupBean();  AddressGroupBean(AddressGroup addressGroup); @Override boolean equals(Object o); @Override int hashCode(); AddressGroup toAddressGroup(); }
AddressGroupBean { public AddressGroup toAddressGroup() { return new AddressGroup( name, ImmutableSortedSet.copyOf(firstNonNull(addresses, ImmutableSet.of())), ImmutableSortedSet.copyOf(firstNonNull(childGroupNames, ImmutableSet.of()))); } @JsonCreator private  AddressGroupBean();  AddressGroupBean(AddressGroup addressGroup); @Override boolean equals(Object o); @Override int hashCode(); AddressGroup toAddressGroup(); public Set<String> addresses; public Set<String> childGroupNames; public String name; }