/** * Get a new constant {@link Value value provider} whose {@link Value#get() get()} * method always returns the instance supplied to the {@code value} parameter. * <p/> * In case the supplied value constant is {@code null}, an {@link #empty() empty} value * provider is returned. * * @param <T> value type. * @param value value instance to be provided. * @return constant value provider. */ public static <T> Value<T> of(final T value) { return (value == null) ? Values.<T>empty() : new InstanceValue<T>(value); }
/** * Get a new constant {@link Value value provider} whose {@link Value#get() get()} * method always returns the instance supplied to the {@code value} parameter. * <p/> * In case the supplied value constant is {@code null}, an {@link #empty() empty} value * provider is returned. * * @param <T> value type. * @param value value instance to be provided. * @return constant value provider. */ public static <T> Value<T> of(final T value) { return (value == null) ? Values.<T>empty() : new InstanceValue<T>(value); }
/** * Get a new constant {@link Value value provider} whose {@link Value#get() get()} * method always returns the instance supplied to the {@code value} parameter. * <p/> * In case the supplied value constant is {@code null}, an {@link #empty() empty} value * provider is returned. * * @param <T> value type. * @param value value instance to be provided. * @return constant value provider. */ public static <T> Value<T> of(final T value) { return (value == null) ? Values.<T>empty() : new InstanceValue<T>(value); }
/** * Get a new constant {@link Value value provider} whose {@link Value#get() get()} * method always returns the instance supplied to the {@code value} parameter. * <p/> * In case the supplied value constant is {@code null}, an {@link #empty() empty} value * provider is returned. * * @param <T> value type. * @param value value instance to be provided. * @return constant value provider. */ public static <T> Value<T> of(final T value) { return (value == null) ? Values.<T>empty() : new InstanceValue<T>(value); }
/** * Get a new constant {@link Value value provider} whose {@link Value#get() get()} * method always returns the instance supplied to the {@code value} parameter. * <p/> * In case the supplied value constant is {@code null}, an {@link #empty() empty} value * provider is returned. * * @param <T> value type. * @param value value instance to be provided. * @return constant value provider. */ public static <T> Value<T> of(final T value) { return (value == null) ? Values.<T>empty() : new InstanceValue<T>(value); }
/** * Get a new constant {@link Value value provider} whose {@link Value#get() get()} * method always returns the instance supplied to the {@code value} parameter. * <p/> * In case the supplied value constant is {@code null}, an {@link #empty() empty} value * provider is returned. * * @param <T> value type. * @param value value instance to be provided. * @return constant value provider. */ public static <T> Value<T> of(final T value) { return (value == null) ? Values.<T>empty() : new InstanceValue<T>(value); }
/** * Get a new constant {@link Value value provider} whose {@link Value#get() get()} * method always returns the instance supplied to the {@code value} parameter. * <p/> * In case the supplied value constant is {@code null}, an {@link #empty() empty} value * provider is returned. * * @param <T> value type. * @param value value instance to be provided. * @return constant value provider. */ public static <T> Value<T> of(final T value) { return (value == null) ? Values.<T>empty() : new InstanceValue<T>(value); }