Java Type Coalesce coalesce(T... ts)

Here you can find the source of coalesce(T... ts)

Description

coalesce

License

Open Source License

Declaration

@SuppressWarnings("unchecked")
    public static <T> T coalesce(T... ts) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    @SuppressWarnings("unchecked")
    public static <T> T coalesce(T... ts) {
        for (T t : ts) {
            if (t != null)
                return t;
        }/*from  www  .  j a v  a 2  s. c  o m*/
        return null;
    }
}

Related

  1. coalesce(T value, T whenNullValue)
  2. coalesce(T... args)
  3. coalesce(T... objects)
  4. coalesce(T... objs)
  5. coalesce(T... tests)
  6. coalesce(T... values)
  7. coalesceString(String... objects)