File tree Expand file tree Collapse file tree
src/main/java/ca/bc/gov/bc_registry_test/dto/bcregistry Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,16 +9,20 @@ public record BcRegistryBusinessAdressesDto(
99 BcRegistryAddressDto mailingAddress ,
1010 BcRegistryAddressDto deliveryAddress
1111) {
12+
1213 public boolean isValid () {
13- return mailingAddress != null || deliveryAddress != null ;
14+ return (mailingAddress != null && mailingAddress .isValid ())
15+ || (deliveryAddress != null && deliveryAddress .isValid ());
1416 }
1517
1618 public Set <BcRegistryAddressDto > addresses () {
1719 Set <BcRegistryAddressDto > addressDtoSet = new HashSet <>();
18- if (mailingAddress != null )
20+ if (mailingAddress != null ) {
1921 addressDtoSet .add (mailingAddress .withAddressType ("mailing" ));
20- if (deliveryAddress != null )
22+ }
23+ if (deliveryAddress != null ) {
2124 addressDtoSet .add (deliveryAddress .withAddressType ("delivery" ));
25+ }
2226 return addressDtoSet ;
2327 }
2428}
You can’t perform that action at this time.
0 commit comments