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


Java StringUtils.containsIgnoreCase方法代码示例

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


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

示例1: generateName

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
private static String generateName(net.minecraft.enchantment.Enchantment target) {
    String candidate;
    Class<?> clz = target.getClass();
    if (clz.getName().startsWith("net.minecraft")) {
        // Keep pattern for vanilla
        candidate = "UNKNOWN_ENCHANT_" + target.effectId;
        return candidate;
    }
    candidate = clz.getSimpleName();
    // Make a nice name when it starts with Enchantment (e.g. EnchantmentSlowFall)
    if (StringUtils.containsIgnoreCase(candidate, "Enchantment")) {
        candidate = candidate.replaceFirst("[E|e]nchantment", "");
        // Add underscores at camelCase humps
        candidate = candidate.replaceAll("([a-z])([A-Z])", "\1_\2").toUpperCase();
        candidate = addSuffix(candidate.toUpperCase());
        return candidate;
    }
    // fall back to the FQN if naming pattern is broken
    candidate = clz.getName();
    candidate = candidate.replaceAll("([a-z])([A-Z])", "\1_\2");
    candidate = candidate.replaceAll("\\.", "_");
    candidate = addSuffix(candidate.toUpperCase());
    return candidate;
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:25,代码来源:CraftEnchantment.java

示例2: check

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
private void check(AlarmRule rule, NodeAlarmEvent alarmEvent) {
    if (!inPeriod(rule)) {
        return;
    }

    String matchValue = rule.getMatchValue();
    matchValue = StringUtils.substringBeforeLast(matchValue, "@");

    String[] matchValues = StringUtils.split(matchValue, ",");

    for (String match : matchValues) {
        if (StringUtils.containsIgnoreCase(alarmEvent.getMessage(), match)) {
            String message = String.format(MESAGE_FORMAT, alarmEvent.getPipelineId(), alarmEvent.getNid(),
                                           alarmEvent.getMessage());
            sendAlarm(rule, message);
            break;
        }
    }
}
 
开发者ID:luoyaogui,项目名称:otter-G,代码行数:20,代码来源:ExceptionRuleMonitor.java

示例3: selectAllInTable

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
private void selectAllInTable(TableViewer debugDataViewer, TableCursor tableCursor){
	Table table = debugDataViewer.getTable();
	TableItem[] tableItems = table.getItems();
	int recordCount = 0;
	
	for(int rowIndex = 0; rowIndex < tableItems.length; rowIndex++){
		TableItem tableItem = tableItems[rowIndex];
		for(int colIndex = 1; colIndex <= table.getColumnCount(); colIndex++){
			if(StringUtils.containsIgnoreCase(tableItem.getText(colIndex), findText.getText())){
				label.setVisible(false);
				tableItem.setBackground(colIndex, Display.getDefault().getSystemColor(SWT.COLOR_DARK_GRAY));
				recordCount++;
			}
		}
		findColIndex=1;
	}
	
	findRowIndex = 0;
	findColIndex = 0;
	
	if(recordCount > 0){
		label.setVisible(true);
		label.setText("Match count - " + recordCount);
	}else{ label.setVisible(false); }
	
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:27,代码来源:FindViewDataDialog.java

示例4: isExistInTable

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
private boolean isExistInTable(TableViewer tableViewer, String text){
  boolean isDataExist = false;
  Table table = tableViewer.getTable();
  TableItem[] tableItems = table.getItems();
  for(int i=0;i<tableItems.length;i++){
	TableItem tableItem = tableItems[i];
	for(int j=1;j <= table.getColumnCount()-1;j++){
		if(StringUtils.containsIgnoreCase(tableItem.getText(j), text)){
			label.setVisible(false);
			isDataExist = true;
			return isDataExist;
		}else{
			label.setVisible(true);
			label.setText(labelText);
			isDataExist =  false;
		}
		
	}
  }
return isDataExist;
 }
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:22,代码来源:FindViewDataDialog.java

示例5: support

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
/**
 * 判断是否是支持的数据库类型
 * @param connection 数据连接
 * @param dbProductName 数据库名称
 * @param dbMajorVersion 数据版本号
 * @return 返回当前方言是否支持当前数据库
 */
public boolean support(Connection connection,String dbProductName,String dbMajorVersion) {
	try {
		DatabaseMetaData databaseMetaData = connection.getMetaData();
		String databaseProductName = databaseMetaData
				.getDatabaseProductName();
		int databaseMajorVersion = databaseMetaData
		.getDatabaseMajorVersion();
		boolean containsMysql = StringUtils.containsIgnoreCase(
				databaseProductName,dbProductName);
		if(StringUtils.isNotEmpty(dbMajorVersion)){
			return containsMysql&&Integer.valueOf(dbMajorVersion)==databaseMajorVersion;
		}
		return containsMysql;
	} catch (SQLException e) {
		return false;
	}
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:25,代码来源:AbstractDialect.java

示例6: isHtml

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
/**
* 
* @Title: isHtml 
* @Description: Check if it is HTML string 
* @param @param html
* @param @return 
* @return boolean
* @throws
 */
public static boolean isHtml(String html)
{
    if (StringUtils.isEmpty(html))
    {
        return false;
    }

    if (StringUtils.containsIgnoreCase(html, FormatConst.HTML_LABEL))
    {
        return true;
    }

    return false;
}
 
开发者ID:wisdomtool,项目名称:formatter,代码行数:24,代码来源:FormatUtil.java

示例7: executeActionForm

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
public String executeActionForm() {
    // 此处在网关URL地址中添加字符集配置参数,主要为解决中文乱码问题
    if (!StringUtils.containsIgnoreCase(this.gatewayUrl, "charset=")) {
        Map<String, String> _params = new HashMap<String, String>();
        _params.put(IAliPay.Const.CHARSET, charset);
        //
        this.gatewayUrl = ParamUtils.appendQueryParamValue(this.gatewayUrl, _params, false, null);
    }
    return ParamUtils.buildActionForm(this.gatewayUrl, true, false, true, charset, requestParameters);
}
 
开发者ID:suninformation,项目名称:ymate-payment-v2,代码行数:11,代码来源:DefaultAliPayRequestSender.java

示例8: forwardTableTraverse

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
private void forwardTableTraverse(TableViewer debugDataViewer, TableCursor tableCursor){
	TableItem previousSelectedTableItem = null;
	if(debugDataViewer.getData("SELECTED_ROW_INDEX")!=null){
		previousSelectedTableItem = debugDataViewer.getTable().getItem((int) debugDataViewer.getData("SELECTED_ROW_INDEX"));
		findColIndex++;
	}
	Table table = debugDataViewer.getTable();
	TableItem[] tableItems = table.getItems();
	if(findColIndex == prevColSelection && findRowIndex == prevRowSelection){
		findColIndex++;
	}
	if(findRowIndex < 0){
		findRowIndex = 0;
	}
	for(;findRowIndex<tableItems.length;){
		TableItem tableItem = tableItems[findRowIndex];
		for(;findColIndex <= table.getColumnCount();findColIndex++){
			if(StringUtils.containsIgnoreCase(tableItem.getText(findColIndex), findText.getText())){
				if(prevColSelection > 0){
					previousSelectedTableItem.setBackground(prevColSelection, Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
				}
				label.setVisible(false);
				table.showItem(tableItem);
				table.showColumn(table.getColumn(findColIndex));
				tableCursor.setSelection(findRowIndex, findColIndex);
				tableCursor.setVisible(false);
				tableItem.setBackground(findColIndex, Display.getDefault().getSystemColor(SWT.COLOR_DARK_GRAY));
				debugDataViewer.setData("SELECTED_ROW_INDEX", findRowIndex);
				debugDataViewer.setData("SEELCTED_COLUMN_INDEX", findColIndex);
				prevColSelection = findColIndex;
				return;
			}
		}
		findRowIndex++;
		findColIndex=1;
		if(findRowIndex >= tableItems.length){ findRowIndex = 0;}
	}
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:39,代码来源:FindViewDataDialog.java

示例9: reverseTableTraverse

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
private void reverseTableTraverse(TableViewer debugDataViewer, TableCursor tableCursor){
	TableItem previousSelectedTableItem = null;
	if(debugDataViewer.getData("SELECTED_ROW_INDEX")!=null){
		previousSelectedTableItem = debugDataViewer.getTable().getItem((int) debugDataViewer.getData("SELECTED_ROW_INDEX"));
		findColIndex -= 1;
	}
	if(findRowIndex < 0){
		findRowIndex = debugDataViewer.getTable().getItems().length - 1;
	}
	Table table = debugDataViewer.getTable();
	TableItem[] tableItems = table.getItems();
	for(; findRowIndex >=0; findRowIndex--){
		TableItem tableItem = tableItems[findRowIndex];
		for( ; findColIndex > 0 ;findColIndex--){
			if(StringUtils.containsIgnoreCase(tableItem.getText(findColIndex), findText.getText())){
				if(prevColSelection > 0){
					previousSelectedTableItem.setBackground(prevColSelection, Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
				}
				label.setVisible(false);
				table.showItem(tableItem);
				table.showColumn(table.getColumn(findColIndex));
				tableCursor.setSelection(findRowIndex, findColIndex);
				tableCursor.setVisible(false);
				tableItem.setBackground(findColIndex,Display.getDefault().getSystemColor(SWT.COLOR_DARK_GRAY));
				if(findColIndex<=0){debugDataViewer.setData("SELECTED_ROW_INDEX", findRowIndex-1);}else{
					debugDataViewer.setData("SELECTED_ROW_INDEX", findRowIndex);
				}
				debugDataViewer.setData("SEELCTED_COLUMN_INDEX", findColIndex);
				prevColSelection = findColIndex;
				prevRowSelection = findRowIndex;
				return ;
			}
			
		}
		if(findColIndex <= 0){ findColIndex = table.getColumnCount();}
		if(findRowIndex == 0){ findRowIndex = tableItems.length; }
	}
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:39,代码来源:FindViewDataDialog.java

示例10: getProposals

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
@Override
public IContentProposal[] getProposals(String contents, int position) {

	proposalList.clear();
	List<PaletteContainer> paletteEntry = paletteRoot.getChildren();
	for (PaletteContainer paletteContainer : paletteEntry) {
		List<PaletteEntry> paletteDrawersList = paletteContainer.getChildren();
		for (PaletteEntry paletteDrawer : paletteDrawersList) {

			if (StringUtils.containsIgnoreCase(
					paletteDrawer.getParent().getLabel() + " : " + paletteDrawer.getLabel(), contents)) {
				String componentName = ((Class) ((CombinedTemplateCreationEntry) paletteDrawer).getTemplate())
						.getSimpleName();
				componentDetails = new ComponentDetails();
				Component component = XMLConfigUtil.INSTANCE.getComponent(componentName);
				componentDetails.setName(componentName);
				componentDetails.setCategoryAndPalletteName(
						paletteDrawer.getParent().getLabel() + " : " + paletteDrawer.getLabel());
				componentDetails.setDescription(component.getDescription());
				componentDetails.setDescriptor(paletteDrawer.getSmallIcon());
				proposalList.add(new ComponentContentProposal(componentDetails));
			}
		}
	}

	componentDetails = new ComponentDetails();
	componentDetails.setName(COMMENT_BOX);
	componentDetails.setCategoryAndPalletteName(COMMENT_BOX);
	componentDetails.setDescription(COMMENT_BOX);
	componentDetails.setDescriptor(getCommentBoxImageDisDescriptor());
	proposalList.add(new ComponentContentProposal(componentDetails));
	return proposalList.toArray(new IContentProposal[0]);
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:34,代码来源:HydrographComponentProposalProvider.java

示例11: visitComment

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
@Override
public void visitComment(SyntaxTrivia trivia) {
  String comment = trivia.text();
  if (StringUtils.containsIgnoreCase(comment, pattern) && !isLetterAround(comment, pattern)) {
    addPreciseIssue(trivia, message);
  }
  super.visitComment(trivia);
}
 
开发者ID:racodond,项目名称:sonar-css-plugin,代码行数:9,代码来源:CommentContainsPatternChecker.java

示例12: doInConnection

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
public Void doInConnection(Connection connection) throws SQLException,
		DataAccessException {
	String productName = connection.getMetaData().getDatabaseProductName();
	LobHandler lobHandler = null;
	if (StringUtils.containsIgnoreCase(productName, ORACLE)) {
		lobHandler = createOracleLobHandler();
	} else {
		lobHandler = createDefaultLobHandler(productName);
	}
	this.lobStoreServiceImpl.setLobHandler(lobHandler);
	return null;
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:13,代码来源:LobStoreServiceImpl.java

示例13: createDefaultLobHandler

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
/**
 * 创建一个通用的的LobHandler,但对SqlServer数据库做了特殊处理.
 * 
 * @param productName
 *            数据库驱动的名称
 * @return 返回DefaultLobHandler对象
 */
private DefaultLobHandler createDefaultLobHandler(String productName) {
	DefaultLobHandler defaultLobHandler = new DefaultLobHandler();
	// 为支持sqljdbc4的处理方式,需要将其大对象流包装到BLOB/CLOB里,否则流将被自动关闭
	if (StringUtils.containsIgnoreCase(productName, SQLSERVER)) {
		defaultLobHandler.setWrapAsLob(true);
	}
	return defaultLobHandler;
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:16,代码来源:LobStoreServiceImpl.java

示例14: main

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception{
    String srcBucketName;
    String scrBucketKey;
    String destBucketName;
    String destPrefix;
    ArgumentParser argumentParser = new ArgumentParser();
    AmazonS3 s3Client = new AmazonS3Client();

    try {
        BucketKey location = argumentParser.parseArguments(args);
        srcBucketName = location.getSrcBucket();
        scrBucketKey = location.getSrcKey();
        destBucketName = location.getDestBucket();
        destPrefix = location.getDestPrefix();
    } catch (ParseException e) {
        LOG.info(PARSE_ERROR_MSG);
        throw new IllegalArgumentException("Parser throw a parse Exception", e);
    }

    // Obtain the original manifest files
    InventoryManifestRetriever inventoryManifestRetriever =
            new InventoryManifestRetriever(s3Client, srcBucketName, scrBucketKey);
    InventoryManifest manifest = inventoryManifestRetriever.getInventoryManifest();

    // Check if the inventory report includes the StorageClass column
    String fileSchema = manifest.getFileSchema();
    String filterColumn = "storageClass";
    if (!StringUtils.containsIgnoreCase(fileSchema, filterColumn)) {
        throw new StorageClassNotIncludedException();
    }

    //Create Spark Context
    SparkConf sparkConf = new SparkConf();
    JavaSparkContext sc = new JavaSparkContext(sparkConf);
    Broadcast<CachedS3ClientFactory> clientFactory = sc.broadcast(new CachedS3ClientFactory());

    // Get the inventory report, split it into lines, parse each line to a POJO,
    // Filter, and write new csv file to S3
    JavaRDD<InventoryManifest.Locator> locatorRDD = sc.parallelize(manifest.getLocators());
    List<InventoryManifest.Locator> newLocatorList = locatorRDD
            .map(new InventoryReportLineRetriever(clientFactory, manifest))
            .flatMap(new InventoryReportMapper(manifest))
            .filter(new ReducedRedundancyStorageClassFilter())
            .mapPartitions(new WriteNewInventoryReportFunc(clientFactory, srcBucketName, manifest,
                    destBucketName, destPrefix))
            .collect();

    // Generate new manifest files including new locators, and send them back to S3
    new ManifestWriter(s3Client, destBucketName, destPrefix, srcBucketName, manifest)
            .writeManifest(newLocatorList);

    sc.close();
}
 
开发者ID:awslabs,项目名称:s3-inventory-usage-examples,代码行数:54,代码来源:ReducedRedundancyLocatorExampleMain.java

示例15: isAPI

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
protected boolean isAPI(TurbineRunData rundata) {
	String requestUrl = rundata.getRequest().getRequestURI();
	return StringUtils.containsIgnoreCase(requestUrl, "/api/");
}
 
开发者ID:luoyaogui,项目名称:otter-G,代码行数:5,代码来源:AuthContextValve.java


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