package uk.ac.ebi.quickgo.annotation.download.converter.helpers;

import java.util.function.Function;

/**
 * A holder for general helper code.
 *
 * @author Tony Wardell
 * Date: 09/04/2018
 * Time: 15:02
 * Created with IntelliJ IDEA.
 */
public class Helper {
    private Helper() {}

    public static final Function<String, String> nullToEmptyString = s -> s == null ? "" : s;
}

@@ -59,16 +59,65 @@
 lpers;%0A%0A
+import java.util.List;%0Aimport java.util.Objects;%0A
 import j
@@ -424,10 +424,347 @@
 %22%22 : s;%0A
+%0A    public static String nullToEmptyString(String reference)%7B%0A        return Objects.nonNull(reference) ? reference : %22%22;%0A    %7D%0A%0A    public static String nullOrEmptyListToEmptyString(List reference, Function%3CList, String%3E mapper)%7B%0A        return Objects.nonNull(reference) %7C%7C !reference.isEmpty() ? mapper.apply(reference) : %22%22;%0A    %7D%0A%0A
 %7D%0A

Add non functional helper methods to turn null Strings in to empty strings and null or empty lists into empty strings.