List of usage examples for org.apache.commons.lang StringUtils lowerCase
public static String lowerCase(String str)
Converts a String to lower case as per String#toLowerCase() .
From source file:su.opencode.shuffler.RenamingVisitor.java
protected String className(List<String> name) { StringBuilder sb = new StringBuilder(); for (String part : name) { if (StringUtils.isBlank(part)) continue; sb.append(StringUtils.capitalize(StringUtils.lowerCase(part))); }// w w w .j a v a2 s . c o m return sb.toString(); }
From source file:su.opencode.shuffler.RenamingVisitor.java
protected String localName(List<String> name) { StringBuilder sb = new StringBuilder(); for (String part : name) { if (StringUtils.isBlank(part)) continue; sb.append(StringUtils.capitalize(StringUtils.lowerCase(part))); }/*w w w. jav a2s. com*/ char first = sb.charAt(0); first = Character.toLowerCase(first); sb.deleteCharAt(0); sb.insert(0, first); return sb.toString(); }
From source file:technology.tikal.accounts.model.InternalAccount.java
public InternalAccount(Account source) { this();//from ww w .j av a 2s. c om if (source.getUser() == null) { throw new NullPointerException(); } this.idUser = StringUtils.lowerCase(source.getUser()); this.setUser(source.getUser()); this.setPassword(source.getPassword()); this.setPersonalInfo(source.getPersonalInfo()); this.setStatus(source.getStatus()); this.setRole(source.getRole()); otpInfo = new OtpInfo(); }
From source file:ttf.analysis.tfidf.TfIdf.java
private Boolean filterToken(Token token) { if (token.getType() != TokenType.WORD /* * && token.getType() != * TokenType.NUMBER */ )//from w w w . j a v a 2 s. co m return false; if (stopset.contains(StringUtils.lowerCase(token.getValue()))) // is a // stop // word return false; if (token.getValue().length() > MaxWordCount) return false; return true; }
From source file:ubic.gemma.image.aba.AllenBrainAtlasServiceImpl.java
/** * The allen brain atlas website 1st letter of gene symbol is capatalized, rest are not (webservice is case * sensitive)/* ww w. j a v a 2s . co m*/ * * @param geneName * @return */ private String correctCase(String geneName) { return StringUtils.capitalize(StringUtils.lowerCase(geneName)); }
From source file:ubic.gemma.loader.genome.gene.ExternalFileGeneLoaderServiceImpl.java
/** * Creates a gene, where gene name and official gene symbol is set to gene symbol(from file) and official name is * set to geneName(from file). The gene description is set to a message indicating that the gene was imported from * an external file and the associated uniprot id. * <p>/*from www.j a va2s. c om*/ * If the gene already exists, then it is not modified, unless it lacks a gene product. In that case we add one and * return it. * * @param fields A string array containing gene symbol, gene name and uniprot id. * @param taxon Taxon relating to gene * @return Gene with associated gene product for loading into Gemma. Null if no gene was loaded (exists, or invalid * fields) or modified. */ private Gene createGene(String[] fields, Taxon taxon) { assert fields.length > 1; String geneSymbol = fields[0]; String geneName = fields[1]; String uniProt = ""; if (fields.length > 2) uniProt = fields[2]; Gene gene = null; // need at least the gene symbol and gene name if (StringUtils.isBlank(geneSymbol) || StringUtils.isBlank(geneName)) { log.warn("Line did not contain valid gene information; GeneSymbol=" + geneSymbol + "GeneName=" + geneName + " UniProt=" + uniProt); return null; } if (log.isDebugEnabled()) log.debug("Creating gene " + geneSymbol); gene = geneService.findByOfficialSymbol(geneSymbol, taxon); if (gene != null) { Collection<GeneProductValueObject> existingProducts = geneService.getProducts(gene.getId()); if (existingProducts.isEmpty()) { log.warn("Gene " + gene + " exists, but has no products; adding one"); gene = geneService.thaw(gene); GeneProduct newgp = createGeneProduct(gene); newgp = geneProductService.create(newgp); gene.getProducts().add(newgp); geneService.update(gene); return gene; } else { log.info(gene + " already exists and is valid, will not update"); return null; // no need to create it, though we ignore the name. } } gene = Gene.Factory.newInstance(); gene.setName(geneSymbol); gene.setOfficialSymbol(geneSymbol); gene.setOfficialName(StringUtils.lowerCase(geneName)); gene.setDescription("Imported from external annotation file"); gene.setTaxon(taxon); gene.getProducts().add(createGeneProduct(gene)); gene = (Gene) persisterHelper.persistOrUpdate(gene); return gene; }