aboutsummaryrefslogtreecommitdiffstats
path: root/component/src/main/java/com/yahoo/container/util/Util.java
blob: 605ae75643b083323cad35eecbeafd21a3e3f643 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.container.util;

/**
 * TODO: What is this?
 *
 * @author Tony Vaagenes
 */
// TODO: Move to a a more appropriate package in vespajlib
// TODO: Fix name
public class Util {

    // TODO: What is this?
    @SafeVarargs
    public static <T> T firstNonNull(T... args) {
        for (T arg : args) {
            if (arg != null)
                return arg;
        }
        return null;
    }

    // TODO: What is this?
    public static String quote(Object object) {
        return "'" + object + "'";
    }
}