List of usage examples for java.lang String valueOf
public static String valueOf(double d)
From source file:Main.java
public static String addDateLesserCondition(String conditions, String key, String value) { if ((conditions == null) || (key == null) || (value == null) || (key == "") || (value == "")) return conditions; conditions = (new StringBuilder(String.valueOf(conditions))).append(" and to_date(").append(key) .append(",'yyyy-mm-dd')<to_date('").append(value).append("','yyyy-mm-dd')").toString(); return conditions; }
From source file:Main.java
public static String addDateGreaterCondition(String conditions, String key, String value) { if ((conditions == null) || (key == null) || (value == null) || (key == "") || (value == "")) return conditions; conditions = (new StringBuilder(String.valueOf(conditions))).append(" and to_date(").append(key) .append(",'yyyy-mm-dd')>to_date('").append(value).append("','yyyy-mm-dd')").toString(); return conditions; }
From source file:Main.java
public static String getMorseForChar(char ch) { return charToMorseTable.get(String.valueOf(ch)); }
From source file:com.datascience.hadoop.CsvInputFormat.java
/** * Creates a CSV format from a Hadoop configuration. *///from www . j a va 2s.c o m private static CSVFormat createFormat(Configuration conf) { CSVFormat format = CSVFormat .newFormat(conf.get(CSV_READER_DELIMITER, DEFAULT_CSV_READER_DELIMITER).charAt(0)) .withSkipHeaderRecord(conf.getBoolean(CSV_READER_SKIP_HEADER, DEFAULT_CSV_READER_SKIP_HEADER)) .withRecordSeparator(conf.get(CSV_READER_RECORD_SEPARATOR, DEFAULT_CSV_READER_RECORD_SEPARATOR)) .withIgnoreEmptyLines( conf.getBoolean(CSV_READER_IGNORE_EMPTY_LINES, DEFAULT_CSV_READER_IGNORE_EMPTY_LINES)) .withIgnoreSurroundingSpaces(conf.getBoolean(CSV_READER_IGNORE_SURROUNDING_SPACES, DEFAULT_CSV_READER_IGNORE_SURROUNDING_SPACES)) .withNullString(conf.get(CSV_READER_NULL_STRING, DEFAULT_CSV_READER_NULL_STRING)); String[] header = conf.getStrings(CSV_READER_COLUMNS); if (header != null && header.length > 0) format = format.withHeader(header); String escape = conf.get(CSV_READER_ESCAPE_CHARACTER, DEFAULT_CSV_READER_ESCAPE_CHARACTER); if (escape != null) format = format.withEscape(escape.charAt(0)); String quote = conf.get(CSV_READER_QUOTE_CHARACTER, DEFAULT_CSV_READER_QUOTE_CHARACTER); if (quote != null) format = format.withQuote(quote.charAt(0)); String quoteMode = conf.get(CSV_READER_QUOTE_MODE, DEFAULT_CSV_READER_QUOTE_MODE); if (quoteMode != null) format = format.withQuoteMode(QuoteMode.valueOf(quoteMode)); return format; }
From source file:Main.java
public static String getMetaString(ApplicationInfo appInfo, String key) { String value = ""; if (appInfo == null) return value; value = String.valueOf(appInfo.metaData.get(key)); if (TextUtils.isEmpty(value)) value = Integer.toString(appInfo.metaData.getInt(key)); return value; }
From source file:Main.java
public static OutputStream out(final JTextArea ta) { return new OutputStream() { public void write(int b) throws IOException { ta.append(String.valueOf((char) b)); }//w w w . j av a 2 s . c o m }; }
From source file:Main.java
public static String checkXMLSting(String origStr) { byte[] origBytes = origStr.getBytes(); StringBuffer sb = new StringBuffer(origBytes.length); for (int i = 0; i < origBytes.length; i++) { System.out.println(i + " =" + String.valueOf(origBytes[i])); if (origBytes[i] < 0) sb.append(" "); else//from ww w . ja v a2 s. com sb.append(origStr.substring(i, i + 1)); } return sb.toString(); }
From source file:Main.java
public static String getNodeValue(Node node) { String ret = ""; if (node != null) { for (Node child = node.getFirstChild(); child != null; child = child.getNextSibling()) ret = (new StringBuilder(String.valueOf(ret))).append(child.getNodeValue()).toString(); }//from w w w.j a v a 2 s .co m return ret; }
From source file:Main.java
public static String byteToHexString(byte[] bytes) { return String.valueOf(encodeHex(bytes)); }
From source file:Main.java
/** * Returns the string value of the given boolean. Returns null if argument * is null.// w ww . j a v a 2 s . co m * * @param value the boolean. * @return the string value. */ public static String valueOf(Boolean value) { return value != null ? String.valueOf(value) : null; }