Method to validate whether the given string is null/empty or has value
@param text
@return boolean
336134
public static boolean hasText(final String text) {
		if (text != null && !"".equals(text.trim())) {
			return true;
		}
		return false;
	}
1290037
private boolean safeParseBoolean(String text, boolean defaultValue) {

        if (text == null) {
            return defaultValue;
        }
        try {
            return Boolean.parseBoolean(text);
        } catch (Throwable t) {
            return defaultValue;
        }
    }
66194
public static boolean isExpression(String text) {
    if (text == null) {
      return false;
    }
    text = text.trim();
    return text.startsWith("${") || text.startsWith("#{");
  }
586707
public static function isNotEmpty($string)
    {
        if (!self::isValid($string) &&
            null !== $string
        ) {
            return false;
        }

        return (!self::isEmpty($string));
    }
1157365
public <V> V convertFrom(final char[] text) {
        if (text == null) return null;
        return (V) convertFrom(text, 0, text.length);
    }
1098055
public static String trimAndNullIfEmpty(final String text) {
        if (text != null && !text.trim().isEmpty()) {
            return text.trim();
        }
        return null;
    }
228643
public static boolean isOnlyEmojis(@Nullable final String text) {
    if (!TextUtils.isEmpty(text)) {
      final String inputWithoutSpaces = SPACE_REMOVAL.matcher(text).replaceAll(Matcher.quoteReplacement(""));

      return EmojiManager.getInstance()
            .getEmojiRepetitivePattern()
            .matcher(inputWithoutSpaces)
            .matches();
    }

    return false;
  }
40899
public boolean has(String value)
    {
        if (values.isEmpty())
        {
            return false;
        }
        for (String v : values)
        {
            if (v.equals(value))
            {
                return true;
            }
        }
        return false;
    }
422983
public static boolean nullSafeEquals(String text1, String text2) {
        if (text1 == null || text2 == null) {
            return false;
        } else {
            return text1.equals(text2);
        }
    }
81399
public static boolean isEmpty(final String aString) {
        boolean result = true;

        if (aString != null) {
            for (int index = 0; index < aString.length(); index++) {
                if (!Character.isWhitespace(aString.charAt(index))) {
                    result = false;
                    break;
                }
            }
        }

        return result;
    }
568381
public boolean matches(String text) {
        if (text == null) {
            return false;
        }
        if (this.regex) {
            final Pattern rx;
            if (this.caseSensitive) {
                rx = Pattern.compile(this.value);
            } else {
                rx = Pattern.compile(this.value, Pattern.CASE_INSENSITIVE);
            }
            return rx.matcher(text).matches();
        } else {
            if (this.caseSensitive) {
                return value.equals(text);
            } else {
                return value.equalsIgnoreCase(text);
            }
        }
    }
1096328
public static boolean empty(final String aString) {
		if (aString != null) {
			final int len = aString.length();

			for (int i = 0; i < len; i++) {
				// This mirrors String.trim(), which removes ASCII
				// control characters as well as whitespace.
				if (aString.charAt(i) > ' ') {
					return false;
				}
			}
		}

		return true;
	}
608787
public T text(CharSequence text, boolean goneIfEmpty) {

        if (goneIfEmpty && (text == null || text.length() == 0)) {
            return gone();
        } else {
            return text(text);
        }
    }
265116
private static boolean isEmpty(MsgNode msg) {
    for (SoyNode child : msg.getChildren()) {
      if (child instanceof RawTextNode && ((RawTextNode) child).getRawText().isEmpty()) {
        continue;
      }
      return false;
    }
    return true;
  }
228461
@Override
    public boolean contains(final String text) {
        for (Tab tab : tabs) {
            if (text.equals(tab.getText())) {
                return true;
            }
        }

        // not found in visible tabs, look in off-page
        return offPageContainer.contains(text);
    }
1181138
public boolean isValid(String value) {
    if (value == null) {
      return false;
    }
    for (int i = 0; i < patterns.length; i++) {
      if (patterns[i].matcher(value).matches()) {
        return true;
      }
    }
    return false;
  }
921465
public static boolean has(String text){
        for(char c : text.toCharArray()){
            if(is(c)){
                return true;
            }
        }
        return false;
    }