List of usage examples for java.lang String toUpperCase
public String toUpperCase()
From source file:com.netspective.commons.config.Property.java
static public String getNameForMapKey(String name) { return name.toUpperCase(); }
From source file:Main.java
public static <T extends Enum<T>> T getAttributeEnum(Node node, String attributeName, Class<T> enumClass, T defaultValue, boolean throwOnError) { String value = getAttribute(node, attributeName, null); if (value == null || value == "") return defaultValue; try {/* w w w .j a v a2 s.co m*/ return Enum.valueOf(enumClass, value.toUpperCase()); } catch (IllegalArgumentException e) { if (throwOnError) throw e; // TODO: Log warning. return defaultValue; } }
From source file:Main.java
/** * byte 2 hex code/*from w ww. j a v a2 s .co m*/ * * @param bytes * @return */ private static String byte2Hex(byte[] bytes) { StringBuilder builder = new StringBuilder(bytes.length * 2); for (int i = 0; i < bytes.length; i++) { String h = Integer.toHexString(bytes[i]); int l = h.length(); if (l == 1) h = "0" + h; if (l > 2) h = h.substring(l - 2, l); builder.append(h.toUpperCase()); if (i < (bytes.length - 1)) builder.append(':'); } return builder.toString(); }
From source file:edu.illinois.cs.cogcomp.question_typer.QuestionTyperFeatureExtractorsUtils.java
private static boolean isCapitalized(String c) { String upperCase = c.toUpperCase(); return upperCase.substring(0, 1).equals(c.substring(0, 1)); }
From source file:org.hyperic.hq.hqapi1.tools.AbstractCommand.java
private static void configureLogging(String level) { Properties props = new Properties(); props.setProperty("log4j.rootLogger", level.toUpperCase() + ", R"); props.setProperty("log4j.logger.httpclient.wire", level.toUpperCase()); props.setProperty("log4j.logger.org.apache.commons.httpclient", level.toUpperCase()); for (String[] PROPS : LOG_PROPS) { props.setProperty(PROPS[0], PROPS[1]); }//from w w w .j a v a2 s.c om props.putAll(System.getProperties()); PropertyConfigurator.configure(props); }
From source file:Main.java
public static String toHexString(byte[] value, int startOffset, int maxLength, boolean uppercase, char separator) { if (maxLength == -1 || startOffset + maxLength > value.length) { maxLength = value.length - startOffset; }//www. ja v a 2s . co m StringBuffer r = new StringBuffer(maxLength * (separator == -1 ? 2 : 3)); for (int i = 0; i < maxLength; i++) { if (i > 0 && separator != 0) { r.append(separator); } String t = Integer.toHexString(value[i + startOffset] & 0xFF); if (t.length() == 1) { t = "0" + t; } if (uppercase) { t = t.toUpperCase(); } r.append(t); } return r.toString(); }
From source file:com.comphenix.xp.parser.Utility.java
public static String getEnumName(String text) { if (text == null) return ""; String filtered = text.toUpperCase(); return filtered.replaceAll("\\s+", "_").replaceAll("\\W", ""); }
From source file:Main.java
/** * @return/*from ww w . j a v a 2 s . c o m*/ */ public static final String bytesToHexString(byte[] bArray) { StringBuffer sb = new StringBuffer(bArray.length); String sTemp; for (int i = 0; i < bArray.length; i++) { sTemp = Integer.toHexString(0xFF & bArray[i]); if (sTemp.length() < 2) sb.append(0); sb.append(sTemp.toUpperCase()); } return sb.toString(); }
From source file:com.aliyun.openservices.odps.console.SelectCommand.java
public static SelectCommand parse(String commandString, ExecutionContext sessionContext) throws ODPSConsoleException { String readCommandString = commandString; // ?"\n"//from ww w . j av a 2 s . co m if (readCommandString.toUpperCase().matches("^SELECT[\\s\\S]*")) { if (!readCommandString.endsWith(";")) { readCommandString = readCommandString + ";"; } return new SelectCommand(readCommandString, sessionContext); } return null; }
From source file:Main.java
private static String bytesToHexString(byte[] bArray) { if (bArray == null) { return null; }/*from www .ja va2s. co m*/ if (bArray.length == 0) { return ""; } StringBuffer sb = new StringBuffer(bArray.length); String sTemp; for (int i = 0; i < bArray.length; i++) { sTemp = Integer.toHexString(0xFF & bArray[i]); if (sTemp.length() < 2) sb.append(0); sb.append(sTemp.toUpperCase()); } return sb.toString(); }