本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
}
示例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;
}
示例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;
}
示例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);
}