@Test void testGetOrDefaultUsingValueProvider() { Function<String, String> valueProvider = o -> o; assertEquals(DEFAULT_VALUE, ObjectUtils.getOrDefault(NULL_INSTANCE, valueProvider, DEFAULT_VALUE)); assertEquals(INSTANCE, ObjectUtils.getOrDefault(INSTANCE, valueProvider, DEFAULT_VALUE)); }
public static <T> T getOrDefault(T instance, Supplier<T> defaultProvider) { if (instance == null) { return defaultProvider.get(); } return instance; }
ObjectUtils { public static <T> T getOrDefault(T instance, Supplier<T> defaultProvider) { if (instance == null) { return defaultProvider.get(); } return instance; } }
ObjectUtils { public static <T> T getOrDefault(T instance, Supplier<T> defaultProvider) { if (instance == null) { return defaultProvider.get(); } return instance; } private  ObjectUtils(); }
ObjectUtils { public static <T> T getOrDefault(T instance, Supplier<T> defaultProvider) { if (instance == null) { return defaultProvider.get(); } return instance; } private  ObjectUtils(); static T getOrDefault(T instance, Supplier<T> defaultProvider); static T getOrDefault(T instance, T defaultValue); static T getNonEmptyOrDefault(T instance, T defaultValue); static T getOrDefault(I instance, Function<I, T> valueProvider, T defaultValue); @SuppressWarnings("unchecked") static Class<T> nullSafeTypeOf(T instance); static long getRemainingOfDeadline(long deadline); }
ObjectUtils { public static <T> T getOrDefault(T instance, Supplier<T> defaultProvider) { if (instance == null) { return defaultProvider.get(); } return instance; } private  ObjectUtils(); static T getOrDefault(T instance, Supplier<T> defaultProvider); static T getOrDefault(T instance, T defaultValue); static T getNonEmptyOrDefault(T instance, T defaultValue); static T getOrDefault(I instance, Function<I, T> valueProvider, T defaultValue); @SuppressWarnings("unchecked") static Class<T> nullSafeTypeOf(T instance); static long getRemainingOfDeadline(long deadline);  }