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