class LicenseNameWithTextUtils {

    public static LicenseNameWithText sanitize(LicenseNameWithText licenseNameWithText) {
        if (licenseNameWithText.isSetLicenseName()) {
            String name = licenseNameWithText.getLicenseName().trim();
            licenseNameWithText.setLicenseName(name.isEmpty() ? null : name);
        }
        if (licenseNameWithText.isSetLicenseText()) {
            String text = licenseNameWithText.getLicenseText().trim();
            licenseNameWithText.setLicenseText(text.isEmpty() ? null : text);
        }
        if (licenseNameWithText.isSetAcknowledgements()) {
            String acknowledgments = licenseNameWithText.getAcknowledgements().trim();
            licenseNameWithText.setAcknowledgements(acknowledgments.isEmpty() ? null : acknowledgments);
        }

        return licenseNameWithText;
    }

}