public abstract class SpringUtils extends Object
Objects
, Class types
and Spring beans.Class
,
Object
,
BeanFactory
,
BeanDefinition
,
RuntimeBeanReference
Modifier and Type | Class and Description |
---|---|
static interface |
SpringUtils.VoidReturningExceptionThrowingOperation
Deprecated.
|
static interface |
SpringUtils.VoidReturningThrowableOperation |
Constructor and Description |
---|
SpringUtils() |
Modifier and Type | Method and Description |
---|---|
static BeanDefinition |
addDependsOn(BeanDefinition beanDefinition,
String... beanNames) |
static String |
defaultIfEmpty(String value,
String defaultValue) |
static String |
defaultIfEmpty(String value,
Supplier<String> supplier) |
static <T> T |
defaultIfNull(T value,
Supplier<T> supplier) |
static <T> T |
defaultIfNull(T value,
T defaultValue) |
static String |
dereferenceBean(String beanName) |
static boolean |
equalsIgnoreNull(Object obj1,
Object obj2) |
static Optional<Object> |
getPropertyValue(BeanDefinition beanDefinition,
String propertyName) |
static boolean |
nullOrEquals(Object obj1,
Object obj2) |
static boolean |
nullSafeEquals(Object obj1,
Object obj2) |
static String |
nullSafeName(Class<?> type) |
static String |
nullSafeSimpleName(Class<?> type) |
static boolean |
safeDoOperation(SpringUtils.VoidReturningThrowableOperation operation) |
static <T> T |
safeGetValue(Supplier<T> valueSupplier) |
static <T> T |
safeGetValue(Supplier<T> valueSupplier,
Function<Throwable,T> exceptionHandler) |
static <T> T |
safeGetValue(Supplier<T> valueSupplier,
Supplier<T> defaultValueSupplier) |
static <T> T |
safeGetValue(Supplier<T> valueSupplier,
T defaultValue) |
static void |
safeRunOperation(SpringUtils.VoidReturningThrowableOperation operation) |
static void |
safeRunOperation(SpringUtils.VoidReturningThrowableOperation operation,
Function<Throwable,RuntimeException> exceptionConverter) |
static BeanDefinition |
setPropertyReference(BeanDefinition beanDefinition,
String propertyName,
String beanName) |
static BeanDefinition |
setPropertyValue(BeanDefinition beanDefinition,
String propertyName,
Object propertyValue) |
public static BeanDefinition addDependsOn(BeanDefinition beanDefinition, String... beanNames)
public static Optional<Object> getPropertyValue(BeanDefinition beanDefinition, String propertyName)
public static BeanDefinition setPropertyReference(BeanDefinition beanDefinition, String propertyName, String beanName)
public static BeanDefinition setPropertyValue(BeanDefinition beanDefinition, String propertyName, Object propertyValue)
public static <T> T defaultIfNull(T value, T defaultValue)
public static <T> T defaultIfNull(T value, Supplier<T> supplier)
public static boolean safeDoOperation(SpringUtils.VoidReturningThrowableOperation operation)
public static <T> T safeGetValue(Supplier<T> valueSupplier)
public static <T> T safeGetValue(Supplier<T> valueSupplier, T defaultValue)
public static <T> T safeGetValue(Supplier<T> valueSupplier, Supplier<T> defaultValueSupplier)
public static <T> T safeGetValue(Supplier<T> valueSupplier, Function<Throwable,T> exceptionHandler)
public static void safeRunOperation(SpringUtils.VoidReturningThrowableOperation operation)
public static void safeRunOperation(SpringUtils.VoidReturningThrowableOperation operation, Function<Throwable,RuntimeException> exceptionConverter)
Copyright © 2011–2019 Pivotal Software, Inc.. All rights reserved.