File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
src/main/java/it/pagopa/selfcare/external_api/mapper Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change 77import lombok .AccessLevel ;
88import lombok .NoArgsConstructor ;
99
10+ import java .util .Optional ;
11+
1012@ NoArgsConstructor (access = AccessLevel .NONE )
1113public class InstitutionMapperCustom {
1214
1315 public static InstitutionUpdateResponse toInstitutionUpdateResponse (Institution institution ) {
1416 InstitutionUpdateResponse institutionUpdate = new InstitutionUpdateResponse ();
1517 institutionUpdate .setAddress (institution .getAddress ());
16- institutionUpdate .setInstitutionType (InstitutionType . valueOf (institution .getInstitutionType ()));
18+ institutionUpdate .setInstitutionType (Optional . ofNullable (institution .getInstitutionType ()). map ( InstitutionType :: valueOf ). orElse ( null ));
1719 institutionUpdate .setDescription (institution .getDescription ());
1820 institutionUpdate .setDigitalAddress (institution .getDigitalAddress ());
1921 institutionUpdate .setTaxCode (institution .getTaxCode ());
You can’t perform that action at this time.
0 commit comments