List of usage examples for java.lang String toUpperCase
public String toUpperCase()
From source file:fm.last.util.StringUtils.java
/** * Escapes the unicode in the given string. * // w ww . ja va 2 s. c om * @param input The input string. * @param escapeAscii Whether to escape ASCII or not. * @return The escaped string. */ public static String escapeUnicodeString(final String input, final boolean escapeAscii) { StringBuffer returnValue = new StringBuffer(""); for (int i = 0; i < input.length(); i++) { char ch = input.charAt(i); if (!escapeAscii && ((ch >= 0x0020) && (ch <= 0x007e))) { returnValue.append(ch); } else { returnValue.append("\\u"); String hex = Integer.toHexString(input.charAt(i) & 0xFFFF); if (hex.length() == 2) { returnValue.append("00"); } returnValue.append(hex.toUpperCase()); } } return returnValue.toString(); }
From source file:th.co.geniustree.dental.spec.DoctorSpec.java
public static Specification<Doctor> emailLike(final String keyword) { return new Specification<Doctor>() { @Override/* www. ja va 2 s . co m*/ public Predicate toPredicate(Root<Doctor> root, CriteriaQuery<?> cq, CriteriaBuilder cb) { return cb.like(cb.upper(root.get(Doctor_.email)), keyword.toUpperCase()); } }; }
From source file:th.co.geniustree.intenship.advisor.spec.CategoryAdviseSpec.java
public static Specification<CategoryAdvise> nameCategoryLike(final String keyword) { return new Specification<CategoryAdvise>() { @Override/*from ww w.jav a 2s .c om*/ public Predicate toPredicate(Root<CategoryAdvise> root, CriteriaQuery<?> cq, CriteriaBuilder cb) { return cb.like(cb.upper(root.get(CategoryAdvise_.nameCategory)), keyword.toUpperCase()); } }; }
From source file:th.co.geniustree.dental.spec.ListSelectHealSpec.java
public static Specification<ListSelectHeal> nameLike(final String keyword) { return new Specification<ListSelectHeal>() { @Override/*from w ww . jav a2 s . c o m*/ public Predicate toPredicate(Root<ListSelectHeal> root, CriteriaQuery<?> cq, CriteriaBuilder cb) { return cb.like(cb.upper(root.get(ListSelectHeal_.name)), keyword.toUpperCase()); } }; }
From source file:org.aectann.postage.TrackingStatusRefreshTask.java
public static TrackingInfo syncRequest(Context context, String tracking) throws FactoryConfigurationError { TrackingInfo result = null;/*from ww w . jav a2 s . c o m*/ if (tracking != null && tracking.length() > 0) { tracking = tracking.toUpperCase(); HttpClient client = new DefaultHttpClient(); try { HttpResponse response = client.execute(new HttpGet("http://prishlo.li/" + tracking + ".xml")); if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { InputStream content = response.getEntity().getContent(); DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); Document document = documentBuilder.parse(content); String weight = getFirstVaueOrNull(document, "weight"); String from = getFirstVaueOrNull(document, "from"); String kind = getFirstVaueOrNull(document, "kind"); TrackingInfo old = TrackingStorageUtils.loadStoredTrackingInfo(tracking, context); result = new TrackingInfo(old != null ? old.getName() : null, tracking, weight, kind, from); NodeList checkpoints = document.getElementsByTagName("checkpoint"); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); for (int i = 0; i < checkpoints.getLength(); i++) { Node current = checkpoints.item(i); NamedNodeMap attributes = current.getAttributes(); Node state = attributes.getNamedItem("state"); Node attribute = attributes.getNamedItem("attribute"); Node date = attributes.getNamedItem("date"); String dateString = date.getNodeValue(); String attributeString = attribute.getNodeValue(); String stateString = state.getNodeValue(); String locationString = current.getFirstChild().getNodeValue(); result.addStatus(new TrackingStatus(stateString, dateFormat.parse(dateString), attributeString, locationString)); } } } catch (Exception e) { if (result == null) { result = new TrackingInfo(null, tracking, null, null, null); } } } return result; }
From source file:th.co.geniustree.dental.spec.PatientSpec.java
public static Specification<Patient> hmLike(final String keyword) { return new Specification<Patient>() { @Override/*from ww w . j a va 2 s . c om*/ public Predicate toPredicate(Root<Patient> root, CriteriaQuery<?> query, CriteriaBuilder cb) { return cb.like(cb.upper(root.get(Patient_.hn)), keyword.toUpperCase()); } }; }
From source file:th.co.geniustree.dental.spec.PatientSpec.java
public static Specification<Patient> nameLike(final String keyword) { return new Specification<Patient>() { @Override//from w ww .java 2 s . c om public Predicate toPredicate(Root<Patient> root, CriteriaQuery<?> query, CriteriaBuilder cb) { return cb.like(cb.upper(root.get(Patient_.name)), keyword.toUpperCase()); } }; }
From source file:th.co.geniustree.dental.spec.PatientSpec.java
public static Specification<Patient> emailLike(final String keyword) { return new Specification<Patient>() { @Override// w ww .jav a 2 s. c o m public Predicate toPredicate(Root<Patient> root, CriteriaQuery<?> query, CriteriaBuilder cb) { return cb.like(cb.upper(root.get(Patient_.email)), keyword.toUpperCase()); } }; }
From source file:com.genentech.retrival.SDFExport.SDFSDFExporter.java
public static SDFSDFExporter createFromStatementStr(String selectStr, String paramTypes, String inFile, String outFile, String[] tagNames, boolean printIfNoRecord, String newLineReplacement) { String[] typeStr = paramTypes.split("\\s+"); DADataType[] pTypes = new DADataType[typeStr.length]; int i = 0;//from w w w.ja v a2 s . co m for (String pStr : typeStr) pTypes[i++] = Enum.valueOf(DADataType.class, pStr.toUpperCase()); i = 0; DAParameterUse[] usg = new DAParameterUse[pTypes.length]; for (String pStr : typeStr) usg[i++] = DAParameterUse.IN; SQLStatement stmt = SQLStatement.createStatement(selectStr, pTypes, usg); return new SDFSDFExporter(stmt, inFile, outFile, tagNames, printIfNoRecord, newLineReplacement); }
From source file:com.ibm.sbt.security.encryption.HMACEncryptionUtility.java
public static String generateSignatureBaseString(String method, String url, String parameterString) throws OAuthException { StringBuilder signatureBaseString = new StringBuilder(); try {/*from w w w . jav a2 s. com*/ signatureBaseString.append(method.toUpperCase()).append("&").append(percentEncode(url)).append("&") .append(URLEncoder.encode(parameterString, "UTF-8")); } catch (UnsupportedEncodingException e) { throw new OAuthException(e, "HMACEncryptionUtility : generateSignatureBaseString caused UnsupportedEncodingException exception"); } return signatureBaseString.toString(); }