ConnectOut-sdp/sdp2023

View on GitHub
app/src/main/java/com/sdpteam/connectout/utils/NullStringUtil.java

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
package com.sdpteam.connectout.utils;

import java.util.Objects;

public class NullStringUtil {

    public static String nonNullString(String s) {
        return nonNullString(s, "");
    }

    public static String nonNullString(String s, String defaultValue) {
        if (s == null) {
            return Objects.requireNonNull(defaultValue);
        }
        return s;
    }
}