Check that a string is not empty if its not null.

@param value value.
@param name parameter name for the exception message.
@return the given value.
654
public static String notEmptyIfNotNull(String value, String name) {
        return notEmptyIfNotNull(value, name, null);
    }
812618
public static <T> T validateNotEmpty(T value, String errorMsg) throws ValidateException {
		if (isEmpty(value)) {
			throw new ValidateException(errorMsg);
		}
		return value;
	}
944833
public void validateTrue(boolean value, String name, String message) {
        if (!value) {
            addError(name, Optional.ofNullable(message).orElse(messages.get(Validation.TRUE_KEY.name(), name)));
        }
    }
1332076
public static String asStringUnchecked(final Object value) {
    try {
      return asString(value);
    } catch (JsonProcessingException e) {
      throw new RuntimeException(e);
    }
  }
233259
@NonNull
  public static String assertNotNullOrEmpty(String text, @Nullable String name) {
    if (isNullOrEmpty(text)) {
      throw new NullPointerException(name + " cannot be null or empty");
    }
    return text;
  }
693167
@NonNull
    public Parameters setString(@NonNull String name, String value) {
        return setValue(name, value);
    }
1373402
public Object getValue(@NonNull String name) {
        if (name == null) { throw new IllegalArgumentException("name cannot be null."); }
        return map.get(name);
    }
62443
@Nonnull
    public static <T> T checkNotNull(T value, @Nonnull String errorMessage) {
        if (value == null) {
            throw new NullPointerException(errorMessage);
        }
        return value;
    }
1019940
public static List<String> get(String name, @Nullable String value) {
    return Args.string(name, value);
  }
412656
public String get(String name) {
        Parameter param = parameters.get(name);
        if (param != null)
            return param.value;
        else
            return null;
    }
1051894
public void setStringIfNotEmpty(@NotNull final String key, @Nullable final String value) {
        if (null != value && !value.isEmpty()) {
            setString(key, value);
        }
    }
999041
static String checkStringArgument(String s, String name) {
    checkNotNull(s, name);
    checkArgument(!s.trim().isEmpty(), "'" + name + "' must not be blank. Was: '" + s + "'");
    return s;
  }
617515
public static void checkNotEmpty(@Nullable String value, @NonNull String message) {
        if (value == null) {
            throw new NullPointerException(message);
        } else if (value.length() == 0) {
            throw new IllegalStateException(message);
        }
    }
574216
protected boolean isEmpty(Object value) {
        if (value == null)
            return true;
        if ( value.equals("") )
            return true;
        return false;
    }
63177
static List<String> string(String name, @Nullable String value) {
    if (!Strings.isNullOrEmpty(value)) {
      return Arrays.asList("--" + name, value);
    }
    return Collections.emptyList();
  }
868600
public static <T> T validateEmpty(T value, String errorMsg) throws ValidateException {
		if (isNotEmpty(value)) {
			throw new ValidateException(errorMsg);
		}
		return value;
	}
975404
public static Pair<String, String> pair (final String name, 
        final boolean value)
        {
        return pair(name, String.valueOf(value));
        }