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


Java StringUtils.equals方法代码示例

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


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

示例1: validate

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
private ActionMessages validate(AuthoringForm sbmtForm, ActionMapping mapping, HttpServletRequest request) {
ActionMessages errors = new ActionMessages();
// if (StringUtils.isBlank(sbmtForm.getTitle())) {
// ActionMessage error = new ActionMessage("error.title.blank");
// errors.add(ActionMessages.GLOBAL_MESSAGE, error);
// }
// define it later mode(TEACHER) skip below validation.
String modeStr = request.getParameter(AttributeNames.ATTR_MODE);
if (StringUtils.equals(modeStr, ToolAccessMode.TEACHER.toString())) {
    return errors;
}

// Some other validation outside basic Tab.

return errors;
   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:17,代码来源:AuthoringAction.java

示例2: getPlaylistMetadataFields

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
@Override
protected Map<String, Map<String, String>> getPlaylistMetadataFields(String... playlistIds) {
    HashMap<String, Map<String, String>> m;
    if (playlistIds == null) {
        throw new IllegalArgumentException("playlistIds must not be null or empty");
    } else if (playlistIds.length == 0) {
        m = new HashMap<String, Map<String, String>>(0);
    } else {
        m = new HashMap<String, Map<String, String>>(playlistIds.length);
        for (String playlistId : playlistIds) {
            Map<String, String> metadata = new LinkedHashMap<String, String>();
            for (MediaCollection mc : mockCollections) {
                if (StringUtils.equals(mc.getIdStr(), playlistId)) {
                    metadata = mc.extractMetadataMap();
                    break;
                }
            }
            m.put(playlistId, metadata);
        }
    }
    return m;
}
 
开发者ID:ITYug,项目名称:kaltura-ce-sakai-extension,代码行数:23,代码来源:KalturaAPIServiceStub.java

示例3: getPlaylistByPlaylistId

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
@Override
public KalturaPlaylist getPlaylistByPlaylistId(String playlistId) {
    if (StringUtils.isEmpty(playlistId)) {
        throw new IllegalArgumentException("playlist id must be set");
    }
    KalturaPlaylist playlist = null;
    for (MediaCollection mc : mockCollections) {
        if (StringUtils.equals(mc.getId(), playlistId)) {
            playlist = makeSamplePlaylist(mc);
            break;
        }
    }
    return playlist;
}
 
开发者ID:ITYug,项目名称:kaltura-ce-sakai-extension,代码行数:15,代码来源:KalturaAPIServiceStub.java

示例4: reset

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
@Override
   public void reset(ActionMapping mapping, HttpServletRequest request) {
String param = mapping.getParameter();
// if it is start page, all data read out from database or current session
// so need not reset checkbox to refresh value!
if (!StringUtils.equals(param, "start") && !StringUtils.equals(param, "initPage")) {
    assessment.setAllowGradesAfterAttempt(false);
    assessment.setAllowOverallFeedbackAfterQuestion(false);
    assessment.setAllowQuestionFeedback(false);
    assessment.setAllowRightAnswersAfterQuestion(false);
    assessment.setAllowWrongAnswersAfterQuestion(false);
    assessment.setDefineLater(false);
    assessment.setShuffled(false);
    assessment.setNumbered(false);
    assessment.setDisplaySummary(false);
    assessment.setReflectOnActivity(false);
}
   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:19,代码来源:AssessmentForm.java

示例5: isPossibleERJoinColumnFilter

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
/**
 * is ER Filter: 1.Filter must be equal(=) 2.Filter must be Column = Column
 * 3.Filter's key and value must be belong different table ex:a.id=b.id true a.id=b.id+1 false
 */
private static boolean isPossibleERJoinColumnFilter(PlanNode node, Item ifilter) {
    if (!(ifilter instanceof ItemFuncEqual))
        return false;
    ItemFuncEqual filter = (ItemFuncEqual) ifilter;
    Item column = filter.arguments().get(0);
    Item value = filter.arguments().get(1);
    if (column != null && column instanceof ItemField && value != null && value instanceof ItemField) {
        Pair<TableNode, ItemField> foundColumn = PlanUtil.findColumnInTableLeaf((ItemField) column, node);
        Pair<TableNode, ItemField> foundValue = PlanUtil.findColumnInTableLeaf((ItemField) value, node);
        if (foundColumn != null && foundValue != null) {
            String columnTable = foundColumn.getValue().getTableName();
            String valueTable = foundValue.getValue().getTableName();
            // the table must be different
            return !StringUtils.equals(columnTable, valueTable);
        } else {
            return false;
        }
    } else {
        return false;
    }
}
 
开发者ID:actiontech,项目名称:dble,代码行数:26,代码来源:FilterJoinColumnPusher.java

示例6: isAnyUpdate

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
private boolean isAnyUpdate(Map<String, Object> oldMap, Map<String, Object> newMap) {
	for(Entry< String , Object> entry:oldMap.entrySet()){
		if(!StringUtils.equals((String)newMap.get(entry.getKey()), (String)entry.getValue())){
			return true;
		}
	}
	return false;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:9,代码来源:OutputAdditionalParametersWidget.java

示例7: resourceHelper

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
@Override
public IOAuthAccessResourceHelper resourceHelper(final String accessToken, final String openId) throws Exception {
    return new IOAuthAccessResourceHelper() {

        private OAuthClientUser _clientUserVO = __moduleCfg.getTokenStorageAdapter().findUserByAccessToken(accessToken);

        @Override
        public OAuthClient getOAuthClient() {
            throw new UnsupportedOperationException();
        }

        @Override
        public OAuthClientUser getOAuthClientUser() {
            return _clientUserVO;
        }

        @Override
        public boolean isExpiredAccessToken() {
            return System.currentTimeMillis() - _clientUserVO.getLastModifyTime() >= _clientUserVO.getExpiresIn() * 1000;
        }

        @Override
        public boolean checkAccessToken() {
            return _clientUserVO != null && (!StringUtils.isNotBlank(openId) || StringUtils.equals(_clientUserVO.getId(), openId));
        }

        @Override
        public boolean checkScope(String scope) {
            return StringUtils.contains(_clientUserVO.getScope(), scope);
        }
    };
}
 
开发者ID:suninformation,项目名称:ymate-module-oauth,代码行数:33,代码来源:OAuth.java

示例8: compare_fields

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
/**
 * 
 * Compares available fields and selected partition key fields for 
 *   hive input and output components. 
 * 
 */
public boolean compare_fields(TableItem[] items,List<String> sourceFieldsList)
{
	ListIterator<String> t_itr,s_itr;
	boolean is_equal=true;
	
	List<String> target_fields = new ArrayList<String>();
	if(items.length > 0){
		for (TableItem tableItem : items){
			target_fields.add((String) tableItem.getText());
		}
	
	
	List<String> source_field = new ArrayList<String>(sourceFieldsList);
	
	t_itr=target_fields.listIterator(target_fields.size());
	s_itr = source_field.listIterator(source_field.size());
	
	
	while(t_itr.hasPrevious() & s_itr.hasPrevious()){
		if(StringUtils.equals(s_itr.previous(),t_itr.previous())){
			is_equal=true;
		}
		else{
			is_equal=false;
			break;
		}
	}
	}
	return is_equal;
	
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:38,代码来源:HiveFieldDialogHelper.java

示例9: saveInLocation

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
/**
 * Saves or updates a large set of items in a location in a single transaction
 * 
 * @param locationId [OPTIONAL] if null or empty then the location in the items/collections are used, 
 *     if set then this overrides any location in the items or collections
 * @param library the items to save in the library for the location
 * @param collections the collections (and items within) to save in the location (this will not remove items)
 * @return the results of the save operation
 * @throws IllegalArgumentException if the locationId is not set AND the item/collection location ids are also not set
 */
public SaveResults saveInLocation(String locationId, Collection<MediaItem> library, Collection<MediaCollection> collections) {
    if (log.isDebugEnabled()) {
        log.debug("saveInLocation(locationId=" + locationId + ", library, collections)");
    }
    // set SaveResults data
    SaveResults saveResults = new SaveResults();
    saveResults.locationId = locationId;
    saveResults.collectionsCount = collections.size();
    saveResults.itemsCount = library.size();
    saveResults.libraryItems = (List<MediaItem>) library;
    saveResults.collections = (List<MediaCollection>) collections;
    // save each collection as a playlist with entries
    for (MediaCollection mc : collections) {
        List<String> entryIds = new ArrayList<String>();
        Map<String, Map<String, String>> metadata = new LinkedHashMap<String, Map<String, String>>();
        for (MediaItem mi : library) {
            // only add items that are members of the collection
            if (StringUtils.equals(mc.getIdStr(), mi.getCollectionId())) {
                String entryId = mi.getKalturaId();
                entryIds.add(entryId);
                metadata.put(entryId, mi.extractMetaDataMap());
            }
        }
        // update each playlist with the entries and metadata
        kalturaAPIService.saveUpdatedKalturaPlaylist(mc.getKalturaPlaylist());
        kalturaAPIService.updateKalturaPlaylistEntries(mc.getKalturaPlaylist(), entryIds, false, metadata);
    }
    return saveResults;
}
 
开发者ID:ITYug,项目名称:kaltura-ce-sakai-extension,代码行数:40,代码来源:MediaService.java

示例10: setMainGraphDirty

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
private void setMainGraphDirty(boolean dirty) {
	if(container.getLinkedMainGraphPath()!=null && container.isCurrentGraphSubjob()){
		for(IEditorReference editorReference:PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getEditorReferences()){
			if(StringUtils.equals(editorReference.getTitleToolTip(), container.getLinkedMainGraphPath())){
				if(editorReference.getEditor(false) instanceof ELTGraphicalEditor);
				((ELTGraphicalEditor)editorReference.getEditor(false)).setDirty(true);
			}
		}
		
	}
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:12,代码来源:ELTGraphicalEditor.java

示例11: getPasteContribution

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
private ActionContributionItem getPasteContribution(IContributionItem[] items) {
	for (IContributionItem contributionItem : items) {
		if (StringUtils.equals(contributionItem.getId(),PASTE_ACTION_ID)) {
			return (ActionContributionItem) contributionItem;
		}
	}
	return null;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:9,代码来源:CustomEditActionProvider.java

示例12: equals

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
@Override
public boolean equals(Object obj) {
    if (obj == null || obj.getClass() != getClass()) {
        return false;
    }
    return StringUtils.equals(toString(), obj.toString());
}
 
开发者ID:JFrogDev,项目名称:jfrog-idea-plugin,代码行数:8,代码来源:ComponentDetailImpl.java

示例13: isWidgetValid

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
@Override
public boolean isWidgetValid() {
		if(StringUtils.equals(combo.getText(), Constants.PARAMETER))
		{	
		 return validateAgainstValidationRule(text.getText());
		}
		return true;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:9,代码来源:DropDownWidget.java

示例14: getCapacity

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
public float getCapacity(String label) {
  if (StringUtils.equals(label, RMNodeLabelsManager.NO_LABEL) && isRoot) {
    return 1f;
  }
  
  return _get(label, CapacityType.CAP);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:QueueCapacities.java

示例15: reset

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
@Override
   public void reset(ActionMapping mapping, HttpServletRequest request) {
String param = mapping.getParameter();
//if it is start page, all data read out from database or current session
//so need not reset checkbox to refresh value!
if (!StringUtils.equals(param, "start") && !StringUtils.equals(param, "initPage")) {
    spreadsheet.setLockWhenFinished(false);
    spreadsheet.setDefineLater(false);
    spreadsheet.setLearnerAllowedToSave(true);
    spreadsheet.setMarkingEnabled(false);
    spreadsheet.setReflectOnActivity(false);
}
   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:14,代码来源:SpreadsheetForm.java


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