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