return value;
}
+ /**
+ * A shortcut for {@code Objects.requireNonNull(value, "Supplied value may not be null")}.
+ *
+ * @param value Value itself
+ * @throws NullPointerException if value is null
+ */
+ public static void requireValue(@Nullable final Object value) {
+ requireNonNull(value, "Supplied value may not be null");
+ }
+
/**
* Append a named value to a ToStringHelper. If the value is null, this method does nothing.
*
* @param value Value to append
* @throws NullPointerException if the name or helper is null
*/
- public static void appendValue(final @NonNull ToStringHelper helper, final @NonNull String name,
+ public static void appendValue(final ToStringHelper helper, final @NonNull String name,
final @Nullable Object value) {
if (value != null) {
helper.add(name, value);
* @param input input list, may be null
* @return Input list or an empty list.
*/
- public static <T> List<T> nonnull(final @Nullable List<T> input) {
+ public static <T> @NonNull List<T> nonnull(final @Nullable List<T> input) {
return input != null ? input : ImmutableList.of();
}