• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java StringValueComparator类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中org.kuali.rice.krad.comparator.StringValueComparator的典型用法代码示例。如果您正苦于以下问题:Java StringValueComparator类的具体用法?Java StringValueComparator怎么用?Java StringValueComparator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

StringValueComparator类属于org.kuali.rice.krad.comparator包,在下文中一共展示了StringValueComparator类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getAppropriateValueComparatorForPropertyClass

点赞 3

import org.kuali.rice.krad.comparator.StringValueComparator; //导入依赖的package包/类
/**
 * This method returns a comparator to be used for comparing propertyValues (in String form)
 * @param propClass
 * @return
 */
public static Comparator getAppropriateValueComparatorForPropertyClass(Class propClass) {
    if (propClass == null) {
        return NullValueComparator.getInstance();
    }
    else if (TypeUtils.isDecimalClass(propClass) || TypeUtils.isIntegralClass(propClass)) {
        return NumericValueComparator.getInstance();
    }
    else if (TypeUtils.isTemporalClass(propClass)) {
        return TemporalValueComparator.getInstance();
    }
    else if (String.class.equals(propClass)) {
        // StringCellComparator is smarter about nulls than String.CASE_INSENSITIVE_ORDER
        return StringValueComparator.getInstance();
    }
    else {
        return ComparableComparator.getInstance();
    }
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:24,
代码来源:CellComparatorHelper.java

示例2: compare

点赞 2

import org.kuali.rice.krad.comparator.StringValueComparator; //导入依赖的package包/类
public int compare(Object o1, Object o2) {
    // null guard. non-null value is greater. equal if both are null
    if (null == o1 || null == o2) {
        return (null == o1 && null == o2) ? 0 : ((null == o1) ? -1 : 1);
    }
    
    String s1 = CellComparatorHelper.getSanitizedStaticValue((Cell) o1);
    String s2 = CellComparatorHelper.getSanitizedStaticValue((Cell) o2);
    
    return StringValueComparator.getInstance().compare(s1, s2);
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:12,
代码来源:StringCellComparator.java

示例3: areAttributesEqual

点赞 2

import org.kuali.rice.krad.comparator.StringValueComparator; //导入依赖的package包/类
protected boolean areAttributesEqual(List<String> uniqueAttributeNames, Map<String, String> aSet1, Map<String, String> aSet2){
	StringValueComparator comparator = StringValueComparator.getInstance();
	for(String uniqueAttributeName: uniqueAttributeNames){
		String attrVal1 = getAttributeValue(aSet1, uniqueAttributeName);
		String attrVal2 = getAttributeValue(aSet2, uniqueAttributeName);
		if(comparator.compare(attrVal1, attrVal2)!=0){
			return false;
		}
	}
	return true;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:12,
代码来源:DataDictionaryTypeServiceBase.java

示例4: checkTravelerFieldForChanges

点赞 1

import org.kuali.rice.krad.comparator.StringValueComparator; //导入依赖的package包/类
/**
 *
 * This method compares profile and traveler field values using {@link StringValueComparator#compare(Object, Object)} and returns the formatted noteText accordingly
 * @param profileFieldValue
 * @param travelerDetailFieldValue
 * @param noteText
 * @param fieldLabel
 * @return
 */
private String checkTravelerFieldForChanges(String profileFieldValue, String travelerDetailFieldValue, String noteText, String fieldLabel) {
    if(StringValueComparator.getInstance().compare(profileFieldValue, travelerDetailFieldValue) == 0){
        return noteText;
    }
    return noteText += fieldLabel + ", " ;
}
 

开发者ID:kuali,
项目名称:kfs,
代码行数:16,
代码来源:TravelDocumentBase.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)