All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.vfdtech.implementations.VStringUtils Maven / Gradle / Ivy

Go to download

A utilities service with generic tools implementation. Can be plugged into your java project

There is a newer version: 0.3.5
Show newest version
package org.vfdtech.implementations;

import org.apache.commons.lang3.StringUtils;
import org.vfdtech.interfaces.IStringUtils;

import java.util.Objects;

public class VStringUtils implements IStringUtils {

    public static String ternaryCheck(Object value, String fallbackValue) {
        return Objects.nonNull(value)
                && StringUtils.isNotBlank(value.toString()) ? (String) value : fallbackValue;
    }

    public static String ternaryCheck(String[] values, int index, String fallbackValue) {
        return (values.length == 0 || values.length < index)
                ? "" : ternaryCheck(values[index], fallbackValue);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy