当前位置: 首页>>代码示例>>Java>>正文


Java StringUtils.containsIgnoreCase方法代码示例

本文整理汇总了Java中org.apache.commons.lang3.StringUtils.containsIgnoreCase方法的典型用法代码示例。如果您正苦于以下问题:Java StringUtils.containsIgnoreCase方法的具体用法?Java StringUtils.containsIgnoreCase怎么用?Java StringUtils.containsIgnoreCase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.commons.lang3.StringUtils的用法示例。


在下文中一共展示了StringUtils.containsIgnoreCase方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getStatus

import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
/**
 * Get the {@link Status} from the string equivalent
 *
 * @param status the string status
 * @return the equivalent {@link Status}
 */
public static Status getStatus(@Nullable final String status) {

    if (UtilsString.notNaked(status)) {

        if (StringUtils.containsIgnoreCase(NOTSTARTED.name(), status)) {
            return NOTSTARTED;
        } else if (StringUtils.containsIgnoreCase(RUNNING.name(), status)) {
            return RUNNING;
        } else if (StringUtils.containsIgnoreCase(FAILED.name(), status)) {
            return FAILED;
        } else if (StringUtils.containsIgnoreCase(SUCCEEDED.name(), status)) {
            return SUCCEEDED;
        }
    }

    return UNDEFINED;
}
 
开发者ID:brandall76,项目名称:Saiy-PS,代码行数:24,代码来源:Speaker.java

示例2: buildLibraryFromRecordType

import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
public Library buildLibraryFromRecordType(Record rec) {
	Library ret = new Library();
	DataTypes types = new DataTypes();
	ret.setTypes(types);
	List<Field> fields = new ArrayList<Field>();
	fields.addAll(rec.getField());
	rec.getField().clear();
	for (Field field : fields) {
		if (StringUtils.containsIgnoreCase(field.getType(), ":")) {
			String[] vals = StringUtils.split(field.getType(), ":");
			field.setType(field.getType());
			Use use = new Use();
			use.setLibrary(LibraryUtil.getLibraryUseNameFromName(vals[0]));
			if (!existing(use, ret))
				ret.getUse().add(use);
		}
		rec.getField().add(field);
	}
	ret.getTypes().getSimpleOrRecordOrConstant().add(rec);
	return ret;
}
 
开发者ID:dstl,项目名称:Open_Source_ECOA_Toolset_AS5,代码行数:22,代码来源:TypesUtil.java

示例3: handleAnySqlPostTranslation

import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
@Override
public String handleAnySqlPostTranslation(String string, Change change) {
    /*
     To make "ALTER TABLE some_Table ALTER COLUMN abcCol NOT NULL"  into
             "ALTER TABLE some_Table ALTER COLUMN abcCol SET NOT NULL"
     */
    //if this is "ALTER TABLE XYZ ALTER COLUMN ABC" statement
    Matcher alterTableAlterColumnMatcher = Pattern.compile("(?i)(alter\\s+table\\s+\\w+\\s+alter\\s+column\\s+\\w+\\s+)(.+)").matcher(string);
    if (alterTableAlterColumnMatcher.find()){

        //if this is ALTER TABLE ALTER COLUMN NULL/NOT NULL in Sybase dialect (without "SET" keyword)
        if( ! StringUtils.containsIgnoreCase(alterTableAlterColumnMatcher.group(2), "set") &&
                StringUtils.containsIgnoreCase(alterTableAlterColumnMatcher.group(2), "null") ){

            Matcher nullOrNotNull = Pattern.compile("(?i)(NOT\\s+NULL|NULL)(.*)").matcher(alterTableAlterColumnMatcher.group(2));
            if(nullOrNotNull.matches()){
                string = alterTableAlterColumnMatcher.group(1) + "SET " + nullOrNotNull.group(1) + nullOrNotNull.group(2);
            }
        }
    }
    return string;
}
 
开发者ID:goldmansachs,项目名称:obevo,代码行数:23,代码来源:AseToH2SqlTranslator.java

示例4: getSearchResults

import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
public static SearchResultsCursor getSearchResults(final String query) {
    final List<Integer> positions = new ArrayList<>();
    final List<LinkedHashMap<Integer, Integer>> indicesTitle = new ArrayList<>();

    int i = 1;

    for (final SyndEntry entry : sCurrentFeed.getEntries()) {
        final String title = entry.getTitle();

        if (StringUtils.containsIgnoreCase(title, query)) {
            indicesTitle.add(SearchUtils.getIndicesForQuery(title, query));
            positions.add(i);
        }
        i++;
    }

    return new SearchResultsCursor(positions, indicesTitle);
}
 
开发者ID:Applications-Development,项目名称:SimpleRssReader,代码行数:19,代码来源:CurrentFeed.java

示例5: buildFromEvent

import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
public ServiceDefinition buildFromEvent(Event data) {
	ServiceDefinition ret = new ServiceDefinition();
	ret.setOperations(new Operations());
	ArrayList<Parameter> param = new ArrayList<Parameter>();
	ArrayList<Use> uses = new ArrayList<Use>();
	for (Parameter para : data.getInput()) {
		if (StringUtils.containsIgnoreCase(para.getType(), ":")) {
			String[] vals = StringUtils.split(para.getType(), ":");
			Use use = new Use();
			use.setLibrary(LibraryUtil.getLibraryUseNameFromName(vals[0]));
			if (!existing(use, uses))
				uses.add(use);
			para.setType(para.getType());
		}
		param.add(para);
	}
	data.getInput().clear();
	data.getInput().addAll(param);
	ret.getUse().clear();
	ret.getUse().addAll(uses);
	ret.getOperations().getDataOrEventOrRequestresponse().add(data);
	return ret;
}
 
开发者ID:dstl,项目名称:Open_Source_ECOA_Toolset_AS5,代码行数:24,代码来源:ServicesUtil.java

示例6: buildLibraryFromArrayType

import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
public Library buildLibraryFromArrayType(Array arr) {
	Library ret = new Library();
	DataTypes types = new DataTypes();
	ret.setTypes(types);
	if (StringUtils.containsIgnoreCase(arr.getItemType(), ":")) {
		String[] vals = StringUtils.split(arr.getItemType(), ":");
		arr.setItemType(arr.getItemType());
		Use use = new Use();
		use.setLibrary(LibraryUtil.getLibraryUseNameFromName(vals[0]));
		if (!existing(use, ret))
			ret.getUse().add(use);
	}
	ret.getTypes().getSimpleOrRecordOrConstant().add(arr);
	return ret;
}
 
开发者ID:dstl,项目名称:Open_Source_ECOA_Toolset_AS5,代码行数:16,代码来源:TypesUtil.java

示例7: handleAnySqlPostTranslation

import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
@Override
public String handleAnySqlPostTranslation(String string, Change change) {
    /*
     To make "ALTER TABLE some_Table ALTER COLUMN abcCol NOT NULL"  into
             "ALTER TABLE some_Table ALTER COLUMN abcCol SET NOT NULL"
     */
    //if this is "ALTER TABLE XYZ ALTER COLUMN ABC" statement
    Matcher alterTableAlterColumnMatcher = Pattern.compile("(?i)(alter\\s+table\\s+\\w+\\s+alter\\s+column\\s+\\w+\\s+)(.+)").matcher(string);
    if (alterTableAlterColumnMatcher.find()) {

        //if this is ALTER TABLE ALTER COLUMN NULL/NOT NULL in Sybase dialect (without "SET" keyword)
        if (!StringUtils.containsIgnoreCase(alterTableAlterColumnMatcher.group(2), "set") &&
                StringUtils.containsIgnoreCase(alterTableAlterColumnMatcher.group(2), "null")) {

            Matcher nullOrNotNull = Pattern.compile("(?i)(NOT\\s+NULL|NULL)(.*)").matcher(alterTableAlterColumnMatcher.group(2));
            if (nullOrNotNull.matches()) {
                string = alterTableAlterColumnMatcher.group(1) + "SET " + nullOrNotNull.group(1) + nullOrNotNull.group(2);
            }
        }
    }
    return string;
}
 
开发者ID:goldmansachs,项目名称:obevo,代码行数:23,代码来源:MsSqlToH2SqlTranslator.java

示例8: isUrlMatchingEntity

import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
public boolean isUrlMatchingEntity(String entity) {
    boolean isLast = StringUtils.endsWithIgnoreCase(url, RedirectorConstants.DELIMETER + entity);
    boolean isInTheMiddle = StringUtils.containsIgnoreCase(url, RedirectorConstants.DELIMETER + entity + RedirectorConstants.DELIMETER);
    boolean isLastBeforeQueryParam = StringUtils.containsIgnoreCase(url, RedirectorConstants.DELIMETER + entity + QUERY_PARAM_START);

    return  isLast || isInTheMiddle || isLastBeforeQueryParam;
}
 
开发者ID:Comcast,项目名称:redirector,代码行数:8,代码来源:Request.java

示例9: isImage

import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
public static boolean isImage(Resource resource) {
    if (null != resource) {
        Asset asset = DamUtil.resolveToAsset(resource);
        if (null != asset) {
            String mimeType = asset.getMimeType();
            return StringUtils.containsIgnoreCase(mimeType, IMAGE);
        }
    }
    return false;
}
 
开发者ID:DantaFramework,项目名称:AEM,代码行数:11,代码来源:ImageUtils.java

示例10: isResponseText

import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
/**
 * 检查响应结果是否为文本内容
 * 
 * @param response
 * @return
 */
private static boolean isResponseText(CloseableHttpResponse response, Header responseEntityContentType) {
	String contentType = responseEntityContentType.getValue();
	if (StringUtils.containsIgnoreCase(contentType, "text")
			|| StringUtils.containsIgnoreCase(contentType, "json")) {
		return true;
	}
	return false;
}
 
开发者ID:AlexLee-CN,项目名称:weixin_api,代码行数:15,代码来源:HttpUtil.java

示例11: comparingNames

import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
public static boolean comparingNames(String name, String otherName) {
    for (String word : getNormalizeName(name).split(" ")) {
        if (!StringUtils.containsIgnoreCase(getNormalizeName(otherName).trim(), word)) {
            return false;
        }
    }
    return true;
}
 
开发者ID:NoraUi,项目名称:NoraUi,代码行数:9,代码来源:NameUtilities.java

示例12: getTransformedResponse

import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
private Object getTransformedResponse(String appid, InputStream content, ContainerRequestContext ctx) {
	if (ctx.getUriInfo().getQueryParameters().containsKey("getRawResponse") ||
			StringUtils.containsIgnoreCase(getPath(ctx), "getRawResponse=")) {
		return content;
	} else {
		try {
			JsonNode tree = ParaObjectUtils.getJsonMapper().readTree(content);
			JsonNode hits = tree.at("/hits/hits");
			if (hits.isMissingNode()) {
				return tree;
			} else {
				List<String> keys = new LinkedList<String>();
				long count = tree.at("/hits/total").asLong();
				for (JsonNode hit : hits) {
					String id = hit.get("_id").asText();
					keys.add(id);
				}
				DAO dao = CoreUtils.getInstance().getDao();
				Map<String, ParaObject> fromDB = dao.readAll(appid, keys, true);
				Map<String, Object> result = new HashMap<>();
				result.put("items", fromDB);
				result.put("totalHits", count);
				return result;
			}
		} catch (IOException ex) {
			logger.error(null, ex);
		}
		return Collections.emptyMap();
	}
}
 
开发者ID:Erudika,项目名称:para-search-elasticsearch,代码行数:31,代码来源:ProxyResourceHandler.java

示例13: buildFromData

import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
public ServiceDefinition buildFromData(Data data) {
	ServiceDefinition ret = new ServiceDefinition();
	ret.setOperations(new Operations());
	if (StringUtils.containsIgnoreCase(data.getType(), ":")) {
		String[] vals = StringUtils.split(data.getType(), ":");
		Use use = new Use();
		use.setLibrary(LibraryUtil.getLibraryUseNameFromName(vals[0]));
		ret.getUse().add(use);
		data.setType(data.getType());
	}
	ret.getOperations().getDataOrEventOrRequestresponse().add(data);
	return ret;
}
 
开发者ID:dstl,项目名称:Open_Source_ECOA_Toolset_AS5,代码行数:14,代码来源:ServicesUtil.java

示例14: buildLibraryFromSimpleType

import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
public Library buildLibraryFromSimpleType(Simple simple) {
	Library ret = new Library();
	DataTypes types = new DataTypes();
	ret.setTypes(types);
	if (StringUtils.containsIgnoreCase(simple.getType(), ":")) {
		String[] vals = StringUtils.split(simple.getType(), ":");
		simple.setType(simple.getType());
		Use use = new Use();
		use.setLibrary(LibraryUtil.getLibraryUseNameFromName(vals[0]));
		if (!existing(use, ret))
			ret.getUse().add(use);
	}
	ret.getTypes().getSimpleOrRecordOrConstant().add(simple);
	return ret;
}
 
开发者ID:dstl,项目名称:Open_Source_ECOA_Toolset_AS5,代码行数:16,代码来源:TypesUtil.java

示例15: test

import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
@Override
public boolean test(final String input) {
    if (null == input || null == value) {
        return false;
    }
    if (ignoreCase) {
        return StringUtils.containsIgnoreCase(input, value);
    }
    return input.contains(value);
}
 
开发者ID:gchq,项目名称:koryphe,代码行数:11,代码来源:StringContains.java


注:本文中的org.apache.commons.lang3.StringUtils.containsIgnoreCase方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。