Java Code Examples for org.apache.commons.lang3.StringUtils.lowerCase()

The following are Jave code examples for showing how to use lowerCase() of the org.apache.commons.lang3.StringUtils class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: InComb   File: QueryUtil.java   View Source Code Vote up 7 votes
/**
 * Returns a {@link BooleanQuery} for the given search text.
 *
 * @param indexType the type in which should be searched.
 * @param search the search text.
 * @param baseBoost highest possible boost of the query. The more the match is exact
 * 			than a bigger boost will be used.
 */
private static BooleanQuery buildSearchTermQuery(final IIndexTypeConf indexType, final String search,
		final float baseBoost) {
	final BooleanQuery subQuery = new BooleanQuery();

	final String lowerCase = StringUtils.lowerCase(search);
	final String capitalized = StringUtils.capitalize(search);

	addSearchTermQueries(indexType, search, subQuery, baseBoost);

	if(!lowerCase.equals(search)) {
		addSearchTermQueries(indexType, lowerCase, subQuery, 0.8f*baseBoost);
	}

	if(!capitalized.equals(search)) {
		addSearchTermQueries(indexType, capitalized, subQuery, 0.8f*baseBoost);
	}

	return subQuery;
}
 
Example 2
Project: smarti   File: MltConfig.java   View Source Code Vote up 6 votes
public MltConfig setSimilarityFields(String lang, Collection<String> similarityFields) {
    lang = StringUtils.lowerCase(lang, Locale.ROOT);
    if(CollectionUtils.isEmpty(similarityFields)){
        langSimilarityFields.remove(lang);
    } else {
        Collection<String> langFields = similarityFields.stream()
                .filter(StringUtils::isNoneBlank)
                .collect(Collectors.toCollection(() -> new LinkedHashSet<>()));
        if(CollectionUtils.isNotEmpty(langFields)){
            langSimilarityFields.put(lang, langFields);
        } else {
            langSimilarityFields.remove(lang);
        }
    }
    return this;
}
 
Example 3
Project: data-migration   File: AnnotationScanUtils.java   View Source Code Vote up 6 votes
public static void newFillClass(Class clz, Map<String, Class<?>> classes,
		Class<? extends Annotation> annotation) {
	try {
		if (annotation == null || clz.getAnnotation(annotation) != null) {
			String table = clz.getSimpleName();
			String key = StringUtils.lowerCase(table);
			
			if (classes.containsKey(key)) {
			}
			
			classes.put(key, clz);
		}
	} catch (Exception e) {
		log.error("class is error,className:"+clz.getName(),e);
	}
}
 
Example 4
Project: hybris-integration-intellij-idea-plugin   File: DefaultHybrisProjectDescriptor.java   View Source Code Vote up 6 votes
private void processHybrisConfig(@NotNull final Hybrisconfig hybrisconfig) {
    final List<ExtensionType> extensionTypeList = hybrisconfig.getExtensions().getExtension();
    for (ExtensionType extensionType : extensionTypeList) {
        final String name = StringUtils.lowerCase(extensionType.getName());
        if (name != null) {
            explicitlyDefinedModules.add(name);
            continue;
        }
        final String dir = extensionType.getDir();
        final int indexSlash = dir.lastIndexOf('/');
        final int indexBack = dir.lastIndexOf('\\');
        final int index = Math.max(indexSlash, indexBack);
        if (index == -1) {
            explicitlyDefinedModules.add(StringUtils.lowerCase(dir));
        } else {
            explicitlyDefinedModules.add(StringUtils.lowerCase(dir.substring(index + 1)));
        }
    }
}
 
Example 5
Project: patternlab-for-sling   File: PatternModel.java   View Source Code Vote up 6 votes
public PatternModel(Resource resource, String patternsPath, String patternId, String jsonDataFile, String templateName, ResourceResolver resourceResolver) throws IOException {
    this.id = PatternLabUtils.constructPatternId(resource.getPath(), patternsPath, templateName, jsonDataFile);
    this.name = StringUtils.lowerCase(StringUtils.isBlank(jsonDataFile) ? templateName : jsonDataFile);
    this.template = templateName;
    this.path = resource.getPath();
    this.dataPath = StringUtils.isNotBlank(jsonDataFile) ? resource.getParent().getPath() + PatternLabConstants.SLASH + jsonDataFile : StringUtils.EMPTY;
    this.displayed = StringUtils.isBlank(patternId) || StringUtils.startsWith(getId(), patternId);
    this.breadcrumb = Lists.newArrayList(new BreadcrumbItemModel(PatternLabUtils.constructPatternId(resource.getPath(), patternsPath), PatternLabUtils.getResourceTitleOrName(resource)));
    if (StringUtils.isNotBlank(jsonDataFile)) {
        this.breadcrumb.add(new BreadcrumbItemModel(PatternLabUtils.constructPatternId(resource.getPath(), patternsPath, templateName), templateName));
    }
    this.breadcrumb.add(new BreadcrumbItemModel(id, name));
    this.code = PatternLabUtils.getDataFromFile(path, resourceResolver);
    this.data = PatternLabUtils.getDataFromFile(dataPath, resourceResolver);
    this.description = constructDescription(jsonDataFile, templateName, resourceResolver);
    this.embeddedPatterns = Sets.newHashSet();
    this.includingPatterns = Sets.newHashSet();
}
 
Example 6
Project: smarti   File: MltConfig.java   View Source Code Vote up 6 votes
public Map.Entry<String,Collection<String>> getSimilarityFields(String lang, boolean fallback) {
    lang = StringUtils.lowerCase(lang, Locale.ROOT);
    Collection<String> langFields = langSimilarityFields.get(lang);
    if(fallback){
        int sepIdx = StringUtils.indexOfAny(lang, '-','_');
        if(sepIdx > 0){
            lang = lang.substring(0, sepIdx);
            langFields = langSimilarityFields.get(lang);
        }
        if(langFields == null && lang != null){
            lang = null;
            langFields = langSimilarityFields.get(lang);
        }
    } //else no fallback
    return langFields == null ? null : new ImmutablePair<>(lang, langFields);
}
 
Example 7
Project: airsonic   File: CustomPropertySourceConfigurer.java   View Source Code Vote up 5 votes
private void addDataSourceProfile(ConfigurableWebApplicationContext ctx) {
    DataSourceConfigType dataSourceConfigType;
    String rawType = ctx.getEnvironment().getProperty(DATASOURCE_CONFIG_TYPE);
    if(StringUtils.isNotBlank(rawType)) {
        dataSourceConfigType = DataSourceConfigType.valueOf(StringUtils.upperCase(rawType));
    } else {
        dataSourceConfigType = DataSourceConfigType.LEGACY;
    }
    String dataSourceTypeProfile = StringUtils.lowerCase(dataSourceConfigType.name());
    List<String> existingProfiles = Lists.newArrayList(ctx.getEnvironment().getActiveProfiles());
    existingProfiles.add(dataSourceTypeProfile);
    ctx.getEnvironment().setActiveProfiles(existingProfiles.toArray(new String[0]));
}
 
Example 8
Project: aaden-pay   File: Page.java   View Source Code Vote up 5 votes
/**
 * 设置排序方式向.
 * 
 * @param order
 *            可选值为desc或asc,多个排序字段时用','分隔.
 */
public void setOrder(final String order) {
	String lowcaseOrder = StringUtils.lowerCase(order);
	// 检查order字符串的合法值
	String[] orders = StringUtils.split(lowcaseOrder, ',');
	for (String orderStr : orders) {
		if (!StringUtils.equals(DESC, orderStr) && !StringUtils.equals(ASC, orderStr)) {
			throw new IllegalArgumentException("排序方向" + orderStr + "不是合法值");
		}
	}
	this.order = lowcaseOrder;
}
 
Example 9
Project: patternlab-for-sling   File: PatternModel.java   View Source Code Vote up 5 votes
public PatternModel(Resource resource, String patternsPath, String patternId, ResourceResolver resourceResolver) throws IOException {
    this.id = PatternLabUtils.constructPatternId(resource.getPath(), patternsPath);
    this.name = StringUtils.lowerCase(PatternLabUtils.getResourceTitleOrName(resource));
    this.template = StringUtils.EMPTY;
    this.path = resource.getPath();
    this.dataPath = StringUtils.EMPTY;
    this.displayed = StringUtils.isBlank(patternId) || StringUtils.startsWith(getId(), patternId);
    this.breadcrumb = Lists.newArrayList(new BreadcrumbItemModel(id, name));
    this.code = PatternLabUtils.getDataFromFile(path, resourceResolver);
    this.data = null;
    final String descriptionPath = StringUtils.substringBeforeLast(path, PatternLabConstants.SELECTOR) + PatternLabConstants.DESCRIPTION_EXT;
    this.description = PatternLabUtils.getDataFromFile(descriptionPath, resourceResolver);
    this.embeddedPatterns = Sets.newHashSet();
    this.includingPatterns = Sets.newHashSet();
}
 
Example 10
Project: bootstrap   File: BackendProxyServlet.java   View Source Code Vote up 5 votes
@Override
protected String filterServerResponseHeader(final HttpServletRequest clientRequest, final Response serverResponse, final String headerName,
		final String headerValue) {
	// Filter some headers
	final String lowerCase = StringUtils.lowerCase(headerName);
	return ArrayUtils.contains(INGNORE_HEADERS, lowerCase)
			|| INGORE_HEADER_VALUE.containsKey(lowerCase) && headerValue.startsWith(INGORE_HEADER_VALUE.get(lowerCase)) ? null : headerValue;
}
 
Example 11
Project: patient-portal   File: User.java   View Source Code Vote up 4 votes
public void setLogin(String login) {
    this.login = StringUtils.lowerCase(login, Locale.ENGLISH);
}
 
Example 12
Project: cyberduck   File: Transmit4BookmarkCollection.java   View Source Code Vote up 4 votes
@Override
public void endElement(final String name, final String elementText) {
    if(null == current) {
        return;
    }
    switch(name) {
        case "object":
            add(current);
            current = null;
            break;
        case "attribute":
            switch(attribute) {
                case "username":
                    current.getCredentials().setUsername(elementText);
                    break;
                case "server":
                    current.setHostname(elementText);
                    break;
                case "protocol":
                    switch(StringUtils.lowerCase(elementText)) {
                        case "webdav":
                            current.setProtocol(protocols.forScheme(Scheme.dav));
                            break;
                        case "webdavs":
                            current.setProtocol(protocols.forScheme(Scheme.davs));
                            break;
                        case "sftp":
                            current.setProtocol(protocols.forScheme(Scheme.sftp));
                            break;
                        case "ftptls":
                        case "ftpssl":
                            current.setProtocol(protocols.forScheme(Scheme.ftps));
                            break;
                        case "ftp":
                            current.setProtocol(protocols.forScheme(Scheme.ftp));
                            break;
                        case "s3":
                            current.setProtocol(protocols.forType(Protocol.Type.s3));
                            break;
                    }
                    // Reset port to default
                    current.setPort(-1);
                    break;
                case "port":
                    final Integer value = Integer.valueOf(elementText);
                    if(value > 0) {
                        current.setPort(value);
                    }
                    break;
                case "nickname":
                    current.setNickname(elementText);
                    break;
                case "initialremotepath":
                    current.setDefaultPath(elementText);
                    break;
            }
    }
}
 
Example 13
Project: cyberduck   File: Application.java   View Source Code Vote up 4 votes
public Application(final String identifier, final String name) {
    this.identifier = StringUtils.lowerCase(identifier);
    this.name = name;
}
 
Example 14
Project: codemotion-2017-taller-de-jhipster   File: User.java   View Source Code Vote up 4 votes
public void setLogin(String login) {
    this.login = StringUtils.lowerCase(login, Locale.ENGLISH);
}
 
Example 15
Project: qualitoast   File: User.java   View Source Code Vote up 4 votes
public void setLogin(String login) {
    this.login = StringUtils.lowerCase(login, Locale.ENGLISH);
}
 
Example 16
Project: iab-spiders-and-robots-java-client   File: IabFile.java   View Source Code Vote up 4 votes
public static String toLowerCase(String value) {
    return StringUtils.lowerCase(value, LOCALE);
}
 
Example 17
Project: vscrawler   File: LowerCase.java   View Source Code Vote up 4 votes
@Override
protected  String handleSingleStr(String input) {
    return StringUtils.lowerCase(input);
}
 
Example 18
Project: opencron   File: PageBean.java   View Source Code Vote up 2 votes
/**
 * 设置排序方式向.
 *
 * @param order
 *            可选值为desc或asc,多个排序字段时用','分隔.
 */
public void setOrder(final String order) {
    this.order = StringUtils.lowerCase(order);
}
 
Example 19
Project: YiDu-Novel   File: TopAction.java   View Source Code Vote up 2 votes
/**
 * 
 * 设置sortColumn
 * 
 * 
 * @param sortColumn
 *            sortColumn
 */
public void setSortColumn(String sortColumn) {
    this.sortColumn = StringUtils.lowerCase(sortColumn);
}
 
Example 20
Project: Yidu   File: TopAction.java   View Source Code Vote up 2 votes
/**
 * 
 * 设置sortColumn
 * 
 * 
 * @param sortColumn
 *            sortColumn
 */
public void setSortColumn(String sortColumn) {
    this.sortColumn = StringUtils.lowerCase(sortColumn);
}