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


Java ObjectUtils.nullSafeEquals方法代码示例

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


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

示例1: setHeader

import org.springframework.util.ObjectUtils; //导入方法依赖的package包/类
/**
 * Set a header.
 *
 * @param name Name
 * @param value Value
 */
public void setHeader(String name, Object value) {
  verifyType(name, value);
  if (value != null) {
    // Modify header if necessary
    if (!ObjectUtils.nullSafeEquals(value, getHeader(name))) {
      this.modified = true;
      this.headers.put(name, value);
    }
  } else {
    // Remove header if available
    if (this.headers.containsKey(name)) {
      this.modified = true;
      this.headers.remove(name);
    }
  }
}
 
开发者ID:netshoes,项目名称:spring-cloud-sleuth-amqp,代码行数:23,代码来源:AmqpMessageHeaderAccessor.java

示例2: equals

import org.springframework.util.ObjectUtils; //导入方法依赖的package包/类
public boolean equals(Object other) {
	if (this == other)
		return true;
	if (other instanceof ServiceDynamicInterceptor) {
		ServiceDynamicInterceptor oth = (ServiceDynamicInterceptor) other;
		return (mandatoryService == oth.mandatoryService && ObjectUtils.nullSafeEquals(holder, oth.holder)
				&& ObjectUtils.nullSafeEquals(filter, oth.filter) && ObjectUtils.nullSafeEquals(retryTemplate,
				oth.retryTemplate));
	} else
		return false;
}
 
开发者ID:eclipse,项目名称:gemini.blueprint,代码行数:12,代码来源:ServiceDynamicInterceptor.java

示例3: getConnection

import org.springframework.util.ObjectUtils; //导入方法依赖的package包/类
/**
 * Specifying a custom username and password doesn't make sense
 * with a single Connection. Returns the single Connection if given
 * the same username and password; throws a SQLException else.
 */
@Override
public Connection getConnection(String username, String password) throws SQLException {
	if (ObjectUtils.nullSafeEquals(username, getUsername()) &&
			ObjectUtils.nullSafeEquals(password, getPassword())) {
		return getConnection();
	}
	else {
		throw new SQLException("SingleConnectionDataSource does not support custom username and password");
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:16,代码来源:SingleConnectionDataSource.java

示例4: visitArray

import org.springframework.util.ObjectUtils; //导入方法依赖的package包/类
protected void visitArray(Object[] arrayVal) {
	for (int i = 0; i < arrayVal.length; i++) {
		Object elem = arrayVal[i];
		Object newVal = resolveValue(elem);
		if (!ObjectUtils.nullSafeEquals(newVal, elem)) {
			arrayVal[i] = newVal;
		}
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:BeanDefinitionVisitor.java

示例5: equals

import org.springframework.util.ObjectUtils; //导入方法依赖的package包/类
public boolean equals(Object other) {
	if (this == other)
		return true;
	if (other instanceof ServiceTCCLInterceptor) {
		ServiceTCCLInterceptor oth = (ServiceTCCLInterceptor) other;
		return (ObjectUtils.nullSafeEquals(loader, oth.loader));
	}
	return false;
}
 
开发者ID:eclipse,项目名称:gemini.blueprint,代码行数:10,代码来源:ServiceTCCLInterceptor.java

示例6: convertProperties

import org.springframework.util.ObjectUtils; //导入方法依赖的package包/类
/**
 * Convert the given merged properties, converting property values
 * if necessary. The result will then be processed.
 * <p>The default implementation will invoke {@link #convertPropertyValue}
 * for each property value, replacing the original with the converted value.
 * @param props the Properties to convert
 * @see #processProperties
 */
protected void convertProperties(Properties props) {
	Enumeration<?> propertyNames = props.propertyNames();
	while (propertyNames.hasMoreElements()) {
		String propertyName = (String) propertyNames.nextElement();
		String propertyValue = props.getProperty(propertyName);
		String convertedValue = convertProperty(propertyName, propertyValue);
		if (!ObjectUtils.nullSafeEquals(propertyValue, convertedValue)) {
			props.setProperty(propertyName, convertedValue);
		}
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:20,代码来源:PropertyResourceConfigurer.java

示例7: equals

import org.springframework.util.ObjectUtils; //导入方法依赖的package包/类
/**
 * <p/>
 * This implementation compares the underlying bundle and path locations.
 */
public boolean equals(Object obj) {
	if (obj == this) {
		return true;
	}
	if (obj instanceof OsgiBundleResource) {
		OsgiBundleResource otherRes = (OsgiBundleResource) obj;
		return (this.path.equals(otherRes.path) && ObjectUtils.nullSafeEquals(this.bundle, otherRes.bundle));
	}
	return false;
}
 
开发者ID:eclipse,项目名称:gemini.blueprint,代码行数:15,代码来源:OsgiBundleResource.java

示例8: equals

import org.springframework.util.ObjectUtils; //导入方法依赖的package包/类
@Override
public boolean equals(Object other) {
	if (this == other) {
		return true;
	}
	if (!(other instanceof BeansException)) {
		return false;
	}
	BeansException otherBe = (BeansException) other;
	return (getMessage().equals(otherBe.getMessage()) &&
			ObjectUtils.nullSafeEquals(getCause(), otherBe.getCause()));
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:13,代码来源:BeansException.java

示例9: equals

import org.springframework.util.ObjectUtils; //导入方法依赖的package包/类
@Override
public boolean equals(Object other)
{
	if( this == other )
	{
		return true;
	}
	if( !(other instanceof CacheKey) )
	{
		return false;
	}
	CacheKey otherKey = (CacheKey) other;
	return (this.method.equals(otherKey.method) && ObjectUtils.nullSafeEquals(this.targetClass,
		otherKey.targetClass));
}
 
开发者ID:equella,项目名称:Equella,代码行数:16,代码来源:SecurityAttributeSource.java

示例10: evaluate

import org.springframework.util.ObjectUtils; //导入方法依赖的package包/类
/**
 * Evaluate the given value as an expression, if necessary.
 * @param value the candidate value (may be an expression)
 * @return the resolved value
 */
protected Object evaluate(TypedStringValue value) {
	Object result = this.beanFactory.evaluateBeanDefinitionString(value.getValue(), this.beanDefinition);
	if (!ObjectUtils.nullSafeEquals(result, value.getValue())) {
		value.setDynamic();
	}
	return result;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:13,代码来源:BeanDefinitionValueResolver.java

示例11: equals

import org.springframework.util.ObjectUtils; //导入方法依赖的package包/类
@Override
public boolean equals(Object other) {
	if (this == other) {
		return true;
	}
	ListenerCacheKey otherKey = (ListenerCacheKey) other;
	return ObjectUtils.nullSafeEquals(this.eventType, otherKey.eventType) &&
			ObjectUtils.nullSafeEquals(this.sourceType, otherKey.sourceType);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:AbstractApplicationEventMulticaster.java

示例12: equals

import org.springframework.util.ObjectUtils; //导入方法依赖的package包/类
@Override
public boolean equals(Object obj) {
	if (this == obj) {
		return true;
	}
	if (!(obj instanceof OpaqueUriComponents)) {
		return false;
	}

	OpaqueUriComponents other = (OpaqueUriComponents) obj;
	return ObjectUtils.nullSafeEquals(getScheme(), other.getScheme()) &&
			ObjectUtils.nullSafeEquals(this.ssp, other.ssp) &&
			ObjectUtils.nullSafeEquals(getFragment(), other.getFragment());

}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:16,代码来源:OpaqueUriComponents.java

示例13: equals

import org.springframework.util.ObjectUtils; //导入方法依赖的package包/类
@Override
public boolean equals(Object other) {
	if (this == other) {
		return true;
	}
	if (!(other instanceof PointcutAdvisor)) {
		return false;
	}
	PointcutAdvisor otherAdvisor = (PointcutAdvisor) other;
	return (ObjectUtils.nullSafeEquals(getAdvice(), otherAdvisor.getAdvice()) &&
			ObjectUtils.nullSafeEquals(getPointcut(), otherAdvisor.getPointcut()));
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:13,代码来源:AbstractPointcutAdvisor.java

示例14: equals

import org.springframework.util.ObjectUtils; //导入方法依赖的package包/类
@Override
public boolean equals(Object other) {
	if (this == other) {
		return true;
	}
	if (!(other instanceof NameMatchTransactionAttributeSource)) {
		return false;
	}
	NameMatchTransactionAttributeSource otherTas = (NameMatchTransactionAttributeSource) other;
	return ObjectUtils.nullSafeEquals(this.nameMap, otherTas.nameMap);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:12,代码来源:NameMatchTransactionAttributeSource.java

示例15: visitPropertyValues

import org.springframework.util.ObjectUtils; //导入方法依赖的package包/类
protected void visitPropertyValues(MutablePropertyValues pvs) {
	PropertyValue[] pvArray = pvs.getPropertyValues();
	for (PropertyValue pv : pvArray) {
		Object newVal = resolveValue(pv.getValue());
		if (!ObjectUtils.nullSafeEquals(newVal, pv.getValue())) {
			pvs.add(pv.getName(), newVal);
		}
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:BeanDefinitionVisitor.java


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