List of usage examples for org.apache.commons.lang StringUtils upperCase
public static String upperCase(String str)
Converts a String to upper case as per String#toUpperCase() .
From source file:com.thistech.spotlink.persistence.CachingTrackingEventsDao.java
@Override protected Serializable getKey(TrackingEvents object) { return StringUtils.upperCase(object.getId()); }
From source file:gov.nih.nci.cabig.caaers.tools.hibernate.WonderfulNamingStrategy.java
@Override public String logicalColumnName(String columnName, String propertyName) { if (ArrayUtils.contains(uppercaseColumns, columnName)) return super.logicalColumnName(StringUtils.upperCase(columnName), propertyName); return super.logicalColumnName(columnName, propertyName); }
From source file:au.edu.anu.portal.portlets.basiclti.adapters.PeoplesoftAdapter.java
/** * Modify the map of params to uppercase the user_id and replace it * /*from w w w . j a v a 2 s. c om*/ * @param params map of launch data params * @return the map, modified */ @Override public Map<String, String> processLaunchData(Map<String, String> params) { log.debug("PeoplesoftAdapter.processLaunchData() called"); params.put("user_id", StringUtils.upperCase(params.get("user_id"))); //add defaults params.putAll(super.getDefaultParameters()); return params; }
From source file:io.kahu.hawaii.domain.EnumProperty.java
@Override public boolean validate(String parsedValue) { return allowedValues.contains(StringUtils.upperCase(parsedValue)); }
From source file:ch.systemsx.cisd.openbis.generic.shared.dto.identifier.ProjectIdentifier.java
public String getProjectCode() { return StringUtils.upperCase(projectCode); }
From source file:com.haulmont.cuba.gui.xml.layout.loaders.SearchFieldLoader.java
@Override public void loadComponent() { super.loadComponent(); SearchField searchField = (SearchField) resultComponent; String minSearchStringLength = element.attributeValue("minSearchStringLength"); if (StringUtils.isNotEmpty(minSearchStringLength)) { searchField.setMinSearchStringLength(Integer.parseInt(minSearchStringLength)); }//from w ww . ja v a 2s. com String modeString = element.attributeValue("mode"); if (StringUtils.isNotEmpty(modeString)) { SearchField.Mode mode; try { mode = SearchField.Mode.valueOf(StringUtils.upperCase(modeString)); } catch (IllegalArgumentException e) { throw new GuiDevelopmentException("Unable to parse mode for search", context.getFullFrameId(), "mode", modeString); } searchField.setMode(mode); } String escapeValueForLike = element.attributeValue("escapeValueForLike"); if (StringUtils.isNotEmpty(escapeValueForLike)) { searchField.setEscapeValueForLike(Boolean.parseBoolean(escapeValueForLike)); } }
From source file:gov.nih.nci.cabig.caaers.service.synchronizer.TreatmentAssignmentSynchronizer.java
public void migrate(Study dbStudy, Study xmlStudy, DomainObjectImportOutcome<Study> outcome) { //create an Index of existing ones (available in DB) Hashtable<String, TreatmentAssignment> dbTacIndexMap = new Hashtable<String, TreatmentAssignment>(); Hashtable<String, TreatmentAssignment> dbCtepIndexMap = new Hashtable<String, TreatmentAssignment>(); for (TreatmentAssignment ta : dbStudy.getActiveTreatmentAssignments()) { String ctepDbId = StringUtils.upperCase(ta.getCtepDbIdentifier()); String tac = StringUtils.upperCase(ta.getCode()); dbTacIndexMap.put(tac, ta);/*from ww w. ja va 2 s.c om*/ if (StringUtils.isNotEmpty(ctepDbId)) dbCtepIndexMap.put(ctepDbId, ta); } //Identify New TreatmentAssignments and also update existing ones. for (TreatmentAssignment xmlTreatmentAssignment : xmlStudy.getTreatmentAssignments()) { // //CAAERS-7367 - /REFACTORED - always prefer the tac that is available. String ctepDbId = StringUtils.upperCase(xmlTreatmentAssignment.getCtepDbIdentifier()); String tac = StringUtils.upperCase(xmlTreatmentAssignment.getCode()); if (StringUtils.isEmpty(tac) && StringUtils.isEmpty(ctepDbId)) continue; //no I cannot process this record TreatmentAssignment ta = null; //try to identify the TA by ctep-id if (StringUtils.isNotEmpty(ctepDbId)) { ta = dbCtepIndexMap.get(ctepDbId); } //TA not found : try to find by tac if (ta == null) ta = dbTacIndexMap.get(tac); //still tac null -- create a new one. if (ta == null) { ta = xmlTreatmentAssignment; dbStudy.addTreatmentAssignment(xmlTreatmentAssignment); continue; } //it is an existing TA, so lets sync up the attributes ta.setCtepDbIdentifier(xmlTreatmentAssignment.getCtepDbIdentifier()); ta.setCode(xmlTreatmentAssignment.getCode()); ta.setDescription(xmlTreatmentAssignment.getDescription()); ta.setComments(xmlTreatmentAssignment.getComments()); ta.setDoseLevelOrder(xmlTreatmentAssignment.getDoseLevelOrder()); //marking the TA as processed by removing it from index dbTacIndexMap.remove(tac); } //soft delete - all the TAs that were not present in XML Study AbstractMutableRetireableDomainObject.retire(dbTacIndexMap.values()); }
From source file:com.naver.timetable.bo.HttpClientBO.java
public String getHttpBody(String url, String method, List<NameValuePair> param) { HttpClient httpClient = null;/* w w w . ja v a 2 s . c o m*/ HttpResponse httpResponse = null; HttpRequestBase httpRequest; try { if (StringUtils.upperCase(method).equals("POST")) { httpRequest = new HttpPost(url); ((HttpPost) httpRequest).setEntity(new UrlEncodedFormEntity(param)); } else { httpRequest = new HttpGet(url); } TrustManager[] trustManagers = new TrustManager[1]; trustManagers[0] = new DefaultTrustManager(); SSLContext sslContext = SSLContext.getInstance("TLS"); sslContext.init(new KeyManager[0], trustManagers, new SecureRandom()); SSLContext.setDefault(sslContext); sslContext.init(null, trustManagers, null); SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(sslContext, SSLConnectionSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER); httpClient = HttpClients.custom().setSSLSocketFactory(sslsf).build(); // httpClient = HttpClientBuilder.create().build(); httpResponse = httpClient.execute(httpRequest); return EntityUtils.toString(httpResponse.getEntity()); } catch (ClientProtocolException e) { LOG.error("Client protocol error : ", e); } catch (IOException e) { LOG.error("IO error : ", e); } catch (KeyManagementException e) { LOG.error("IO error : ", e); } catch (NoSuchAlgorithmException e) { LOG.error("IO error : ", e); } finally { // ? HttpClientUtils.closeQuietly(httpResponse); HttpClientUtils.closeQuietly(httpClient); } return null; }
From source file:com.btobits.automator.ant.types.TimeValue.java
public TimeValue(final String inXmlValue) { this();/*from w ww .j av a 2 s.c o m*/ final String value[] = StringUtils.split(StringUtils.trim(inXmlValue), " "); switch (value.length) { case 1: duration = Long.parseLong(StringUtils.trim(value[0])); break; case 2: try { duration = Long.parseLong(StringUtils.trim(value[0])); unit = TimeUnit.valueOf(StringUtils.upperCase(StringUtils.trim(value[1]))); } catch (final IllegalArgumentException e) { throw new BuildException("Unable to extract time unit name from [" + value[1] + "]. Please use one of following: NANOSECONDS | MICROSECONDS | MILLISECONDS | SECONDS | MINUTES | HOURS | DAYS"); // log.error("catch generic exception: " + e); // log.error(StackTraceUtil.getStackTrace(e)); } break; default: throw new IllegalArgumentException("Unable to extract TimeValue from [" + inXmlValue + "]"); } }
From source file:edu.mayo.cts2.framework.plugin.service.bprdf.model.modifier.UpperCaseModifier.java
@Override public String beforeSetting(String object) { return StringUtils.upperCase(object); }