Project

General

Profile

1
package eu.dnetlib.dhp.common.string;
2

    
3
/**
4
 * Operations on {@link CharSequence} 
5
 * 
6
 * @author Łukasz Dumiszewski
7
*/
8

    
9
public final class CharSequenceUtils {
10

    
11
    
12
    //------------------------ CONSTRUCTORS --------------------------
13
    
14
    private CharSequenceUtils() {
15
        throw new IllegalStateException("may not be initialized");
16
    }
17
    
18
    
19
    //------------------------ LOGIC --------------------------
20
    
21
    /**
22
     * Converts the given {@link CharSequence} <code>value</code> to {@link String} by using {@link CharSequence#toString()}.
23
     * Returns empty string if <code>value</code> is null.
24
     */
25
    public static String toStringWithNullToEmpty(CharSequence value) {
26
        
27
        return value == null? "": value.toString();
28
        
29
    }
30
    
31
}
(1-1/4)