Throws an IllegalStateException when the given value is null.
@return the value
432620
public static <T> T assertNotNull(T value, String message) {
        if (value == null)
            throw new IllegalStateException(message);
        return value;
    }
513840
public T getDefaultValue() {
		if (defaultValue != null) {
			if (serializer != null) {
				return serializer.copy(defaultValue);
			} else {
				throw new IllegalStateException("Serializer not yet initialized.");
			}
		} else {
			return null;
		}
	}
111909
public static <T> Optional<T> of(final T value) throws NullPointerException {
        if (value == null) {
            throw new NullPointerException("A null value was passed which is not allowed to be null."
                    + " Use #ofNullable(T) if the value can be null.");
        }
        return new Optional<T>(value);
    }
379000
public static <T> void notNull(final String name, final T value) {
    if (value == null) {
      throw new IllegalArgumentException(name + " can not be null");
    }
  }
251441
public static Boolean assertFalse(Boolean value, String message) {
        if (Boolean.valueOf(value))
            throw new IllegalStateException(message);
        return value;
    }
1279781
public static ReplyStatus fromValue(int value) {
        ReplyStatus status = VALUES.get(value);
        if (status == null) {
            status = new ReplyStatus(value);
            VALUES.put(value, status);
        }
        return status;
    }
940724
public AtomicValue<byte[]>     get() throws Exception
    {
        MutableAtomicValue<byte[]>  result = new MutableAtomicValue<byte[]>(null, null, false);
        getCurrentValue(result, new Stat());
        result.postValue = result.preValue;
        result.succeeded = true;
        return result;
    }
300217
public static NfsStatus fromValue(int value) {
        NfsStatus status = VALUES.get(value);
        if (status == null) {
            status = new NfsStatus(value);
            VALUES.put(value, status);
        }
        return status;
    }
1311134
@Override
    public int intValue() {
	if (Math.abs(amount) <= Integer.MAX_VALUE) {
	    return (int) amount;
	}
	throw new IllegalStateException("Amount of '" + amount + "' cannot be converted into an Integer.");
    }
1061722
public static Float checkNull(Float value, Float elseValue) {
        return isNull(value) ? elseValue : value;
    }
452148
public static Double checkNull(Double value, Double elseValue) {
        return isNull(value) ? elseValue : value;
    }
774998
public static String safeToString(Object value) {
    try {
      // TODO(b/36844237): Re-evaluate if this is the best place for null handling (null is also
      // handled for arguments via visitNull() and this is only for literal arguments).
      return value != null ? toString(value) : "null";
    } catch (RuntimeException e) {
      return getErrorString(value, e);
    }
  }
895556
public static Optional<String> getSpecifiedValue(@Nullable String value) {
        return isSpecified(value) ? Optional.ofNullable(value) : Optional.empty();
    }
71763
@Override
    public Object getValue(@NonNull String key) {
        if (key == null) { throw new IllegalArgumentException("key cannot be null."); }

        final int index = indexForColumnName(key);
        return index >= 0 ? getValue(index) : null;
    }
245267
public static <T> T assertNotNull(T object, String fieldName) throws IllegalArgumentException {
        if (object == null) {
            throw new IllegalArgumentException(String.format("%s cannot be null", fieldName));
        }
        return object;
    }
613491
public static <T, S extends T> Optional<T> of(S value) {
    if (value == null) {
      throw new IllegalArgumentException("Optional does not support NULL, use Optional.empty() instead.");
    }

    return new Optional<T>(value);
  }
966378
private void _badType(int type, Object value)
    {
        if (type < 0) {
            throw new IllegalStateException(String.format(
                    "Internal error: missing BeanDefinition for id %d (class %s)",
                    type, value.getClass().getName()));
        }
        String typeDesc = (value == null) ? "NULL" : value.getClass().getName();
        throw new IllegalStateException(String.format("Unsupported type: %s (%s)", type, typeDesc));
    }