Java Code Examples for org.apache.commons.lang.ObjectUtils#notEqual()

The following examples show how to use org.apache.commons.lang.ObjectUtils#notEqual() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ExtendedMessageFormat.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Check if this extended message format is equal to another object.
 *
 * @param obj the object to compare to
 * @return true if this object equals the other, otherwise false
 * @since 2.6
 */
public boolean equals(Object obj) {
    if (obj == this) {
        return true;
    }
    if (obj == null) {
        return false;
    }
    if (!super.equals(obj)) {
        return false;
    }
    if (ObjectUtils.notEqual(getClass(), obj.getClass())) {
      return false;
    }
    ExtendedMessageFormat rhs = (ExtendedMessageFormat)obj;
    if (ObjectUtils.notEqual(toPattern, rhs.toPattern)) {
        return false;
    }
    if (ObjectUtils.notEqual(registry, rhs.registry)) {
        return false;
    }
    return true;
}
 
Example 2
Source File: BaseFunctionResolver.java    From metron with Apache License 2.0 6 votes vote down vote up
/**
 * Performs the core process of function resolution.
 */
protected Map<String, StellarFunctionInfo> resolveFunctions() {

  // maps a function name to its definition
  Map<String, StellarFunctionInfo> functions = new HashMap<>();

  for(Class<? extends StellarFunction> clazz : resolvables()) {
    StellarFunctionInfo fn = resolveFunction(clazz);
    if(fn != null) {
      // check for duplicate function names
      StellarFunctionInfo fnSameName = functions.get(fn.getName());
      if (fnSameName != null && ObjectUtils.notEqual(fnSameName, fn)) {
        LOG.warn("Namespace conflict: duplicate function names; `{}` implemented by [{}, {}]",
            fn.getName(), fnSameName.getFunction(), fn.getFunction());
      }

      functions.put(fn.getName(), fn);
    }
  }

  return functions;
}
 
Example 3
Source File: EmployeeFundingLookupableHelperServiceImpl.java    From kfs with GNU Affero General Public License v3.0 5 votes vote down vote up
/** 
 * Searches the given collection for an element that is equal to the given exhibit for purposes of consolidation.
 *
 * @param coll The collection to search for a like element.
 * @param exhibit The search criteria.
 *
 * @return The element from the collection that matches the exhibit or null if 1) no items match or 
 *   the 2) exhibit is null.
 *
 */
private static EmployeeFunding findEmployeeFunding(Collection<EmployeeFunding> coll, EmployeeFunding exhibit){
    if (exhibit == null){
        return null;
    }

    for (EmployeeFunding temp : coll){
        if (temp == null){
            continue;
        }

        if (ObjectUtils.notEqual(temp.getEmplid(), exhibit.getEmplid())){
            continue;
        }
        if (ObjectUtils.notEqual(temp.getUniversityFiscalYear(), exhibit.getUniversityFiscalYear())){
            continue;
        }
        if (ObjectUtils.notEqual(temp.getChartOfAccountsCode(), exhibit.getChartOfAccountsCode())){
            continue;
        }
        if (ObjectUtils.notEqual(temp.getAccountNumber(), exhibit.getAccountNumber())){
            continue;
        }
        if (ObjectUtils.notEqual(temp.getSubAccountNumber(), exhibit.getSubAccountNumber())){
            continue;
        }
        if (ObjectUtils.notEqual(temp.getFinancialObjectCode(), exhibit.getFinancialObjectCode())){
            continue;
        }
        if (ObjectUtils.notEqual(temp.getFinancialSubObjectCode(), exhibit.getFinancialSubObjectCode())){
            continue;
        }
        if (ObjectUtils.notEqual(temp.getPositionNumber(), exhibit.getPositionNumber())){
            continue;
        }
        return temp;
    }
    /*no items in the collection match the exhibit.*/
    return null;
}