org.springframework.util.ObjectUtils.nullSafeEquals()

Here are the examples of the java api org.springframework.util.ObjectUtils.nullSafeEquals() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

78 Examples 7

19 Source : SpringIterableConfigurationPropertySource.java
with Apache License 2.0
from yuanmabiji

private Cache getCache() {
    CacheKey cacheKey = CacheKey.get(getPropertySource());
    if (cacheKey == null) {
        return null;
    }
    if (ObjectUtils.nullSafeEquals(cacheKey, this.cacheKey)) {
        return this.cache;
    }
    this.cache = new Cache();
    this.cacheKey = cacheKey.copy();
    return this.cache;
}

19 Source : Bindable.java
with Apache License 2.0
from yuanmabiji

private boolean nullSafeEquals(Object o1, Object o2) {
    return ObjectUtils.nullSafeEquals(o1, o2);
}

19 Source : SelectedValueComparator.java
with MIT License
from Vip-Augus

/**
 * Returns {@code true} if the supplied candidate value is equal to the value bound to
 * the supplied {@link BindStatus}. Equality in this case differs from standard Java equality and
 * is described in more detail <a href="#equality-contract">here</a>.
 */
public static boolean isSelected(BindStatus bindStatus, @Nullable Object candidateValue) {
    // Check obvious equality matches with the candidate first,
    // both with the rendered value and with the original value.
    Object boundValue = bindStatus.getValue();
    if (ObjectUtils.nullSafeEquals(boundValue, candidateValue)) {
        return true;
    }
    Object actualValue = bindStatus.getActualValue();
    if (actualValue != null && actualValue != boundValue && ObjectUtils.nullSafeEquals(actualValue, candidateValue)) {
        return true;
    }
    if (actualValue != null) {
        boundValue = actualValue;
    } else if (boundValue == null) {
        return false;
    }
    // Non-null value but no obvious equality with the candidate value:
    // go into more exhaustive comparisons.
    boolean selected = false;
    if (candidateValue != null) {
        if (boundValue.getClreplaced().isArray()) {
            selected = collectionCompare(CollectionUtils.arrayToList(boundValue), candidateValue, bindStatus);
        } else if (boundValue instanceof Collection) {
            selected = collectionCompare((Collection<?>) boundValue, candidateValue, bindStatus);
        } else if (boundValue instanceof Map) {
            selected = mapCompare((Map<?, ?>) boundValue, candidateValue, bindStatus);
        }
    }
    if (!selected) {
        selected = exhaustiveCompare(boundValue, candidateValue, bindStatus.getEditor(), null);
    }
    return selected;
}

19 Source : AssertionErrors.java
with MIT License
from Vip-Augus

/**
 * replacedert two objects are not equal and raise an {@link replacedertionError} otherwise.
 * <p>For example:
 * <pre clreplaced="code">
 * replacedertNotEquals("Response header [" + name + "]", expected, actual);
 * </pre>
 * @param message describes the value being checked
 * @param expected the expected value
 * @param actual the actual value
 */
public static void replacedertNotEquals(String message, @Nullable Object expected, @Nullable Object actual) {
    if (ObjectUtils.nullSafeEquals(expected, actual)) {
        throw new replacedertionError(message + " was not expected to be:" + "<" + ObjectUtils.nullSafeToString(actual) + ">");
    }
}

19 Source : Ternary.java
with MIT License
from Vip-Augus

private void computeExitTypeDescriptor() {
    if (this.exitTypeDescriptor == null && this.children[1].exitTypeDescriptor != null && this.children[2].exitTypeDescriptor != null) {
        String leftDescriptor = this.children[1].exitTypeDescriptor;
        String rightDescriptor = this.children[2].exitTypeDescriptor;
        if (ObjectUtils.nullSafeEquals(leftDescriptor, rightDescriptor)) {
            this.exitTypeDescriptor = leftDescriptor;
        } else {
            // Use the easiest to compute common super type
            this.exitTypeDescriptor = "Ljava/lang/Object";
        }
    }
}

19 Source : Elvis.java
with MIT License
from Vip-Augus

private void computeExitTypeDescriptor() {
    if (this.exitTypeDescriptor == null && this.children[0].exitTypeDescriptor != null && this.children[1].exitTypeDescriptor != null) {
        String conditionDescriptor = this.children[0].exitTypeDescriptor;
        String ifNullValueDescriptor = this.children[1].exitTypeDescriptor;
        if (ObjectUtils.nullSafeEquals(conditionDescriptor, ifNullValueDescriptor)) {
            this.exitTypeDescriptor = conditionDescriptor;
        } else {
            // Use the easiest to compute common super type
            this.exitTypeDescriptor = "Ljava/lang/Object";
        }
    }
}

19 Source : AnnotationTypeMapping.java
with MIT License
from Vip-Augus

private static boolean areEquivalent(@Nullable Object value, @Nullable Object extractedValue, BiFunction<Method, Object, Object> valueExtractor) {
    if (ObjectUtils.nullSafeEquals(value, extractedValue)) {
        return true;
    }
    if (value instanceof Clreplaced && extractedValue instanceof String) {
        return areEquivalent((Clreplaced<?>) value, (String) extractedValue);
    }
    if (value instanceof Clreplaced[] && extractedValue instanceof String[]) {
        return areEquivalent((Clreplaced[]) value, (String[]) extractedValue);
    }
    if (value instanceof Annotation) {
        return areEquivalent((Annotation) value, extractedValue, valueExtractor);
    }
    return false;
}

19 Source : Spr3775InitDestroyLifecycleTests.java
with MIT License
from Vip-Augus

private void replacedertMethodOrdering(Clreplaced<?> clazz, String category, List<String> expectedMethods, List<String> actualMethods) {
    debugMethods(clazz, category, actualMethods);
    replacedertTrue("Verifying " + category + ": expected<" + expectedMethods + "> but got<" + actualMethods + ">.", ObjectUtils.nullSafeEquals(expectedMethods, actualMethods));
}

19 Source : PropertyBatchUpdateException.java
with MIT License
from Vip-Augus

/**
 * Return the exception for this field, or {@code null} if there isn't any.
 */
@Nullable
public PropertyAccessException getPropertyAccessException(String propertyName) {
    for (PropertyAccessException pae : this.propertyAccessExceptions) {
        if (ObjectUtils.nullSafeEquals(propertyName, pae.getPropertyName())) {
            return pae;
        }
    }
    return null;
}

19 Source : AssertionErrors.java
with Apache License 2.0
from SourceHot

/**
 * replacedert two objects are not equal and raise an {@link replacedertionError} otherwise.
 * <p>For example:
 * <pre clreplaced="code">
 * replacedertNotEquals("Response header [" + name + "]", expected, actual);
 * </pre>
 * @param message a message that describes the value being checked
 * @param expected the expected value
 * @param actual the actual value
 */
public static void replacedertNotEquals(String message, @Nullable Object expected, @Nullable Object actual) {
    if (ObjectUtils.nullSafeEquals(expected, actual)) {
        throw new replacedertionError(message + " was not expected to be:" + "<" + ObjectUtils.nullSafeToString(actual) + ">");
    }
}

19 Source : Spr3775InitDestroyLifecycleTests.java
with Apache License 2.0
from SourceHot

private void replacedertMethodOrdering(Clreplaced<?> clazz, String category, List<String> expectedMethods, List<String> actualMethods) {
    debugMethods(clazz, category, actualMethods);
    replacedertThat(ObjectUtils.nullSafeEquals(expectedMethods, actualMethods)).as("Verifying " + category + ": expected<" + expectedMethods + "> but got<" + actualMethods + ">.").isTrue();
}

19 Source : ObjectUtilsTests.java
with MIT License
from mindcarver

@Test
public void nullSafeEqualsWithArrays() throws Exception {
    replacedertTrue(ObjectUtils.nullSafeEquals(new String[] { "a", "b", "c" }, new String[] { "a", "b", "c" }));
    replacedertTrue(ObjectUtils.nullSafeEquals(new int[] { 1, 2, 3 }, new int[] { 1, 2, 3 }));
}

19 Source : SchemaDefinition.java
with Apache License 2.0
from learningtcc

public FieldDefinition getFieldDefinition(String name) {
    if (CollectionUtils.isEmpty(this.fields)) {
        return null;
    }
    for (FieldDefinition fd : this.fields) {
        if (ObjectUtils.nullSafeEquals(fd.getName(), name)) {
            return fd;
        }
    }
    return null;
}

19 Source : SelectedValueComparator.java
with Apache License 2.0
from langtianya

/**
 * Returns {@code true} if the supplied candidate value is equal to the value bound to
 * the supplied {@link BindStatus}. Equality in this case differs from standard Java equality and
 * is described in more detail <a href="#equality-contract">here</a>.
 */
public static boolean isSelected(BindStatus bindStatus, Object candidateValue) {
    if (bindStatus == null) {
        return (candidateValue == null);
    }
    // Check obvious equality matches with the candidate first,
    // both with the rendered value and with the original value.
    Object boundValue = bindStatus.getValue();
    if (ObjectUtils.nullSafeEquals(boundValue, candidateValue)) {
        return true;
    }
    Object actualValue = bindStatus.getActualValue();
    if (actualValue != null && actualValue != boundValue && ObjectUtils.nullSafeEquals(actualValue, candidateValue)) {
        return true;
    }
    if (actualValue != null) {
        boundValue = actualValue;
    } else if (boundValue == null) {
        return false;
    }
    // Non-null value but no obvious equality with the candidate value:
    // go into more exhaustive comparisons.
    boolean selected = false;
    if (boundValue.getClreplaced().isArray()) {
        selected = collectionCompare(CollectionUtils.arrayToList(boundValue), candidateValue, bindStatus);
    } else if (boundValue instanceof Collection) {
        selected = collectionCompare((Collection<?>) boundValue, candidateValue, bindStatus);
    } else if (boundValue instanceof Map) {
        selected = mapCompare((Map<?, ?>) boundValue, candidateValue, bindStatus);
    }
    if (!selected) {
        selected = exhaustiveCompare(boundValue, candidateValue, bindStatus.getEditor(), null);
    }
    return selected;
}

19 Source : ProfileValueUtils.java
with Apache License 2.0
from langtianya

/**
 * Determine if the {@code value} (or one of the {@code values})
 * in the supplied {@link IfProfileValue @IfProfileValue} annotation is
 * <em>enabled</em> in the current environment.
 *
 * @param profileValueSource the ProfileValueSource to use to determine if
 * the test is enabled
 * @param ifProfileValue the annotation to introspect; may be
 * {@code null}
 * @return {@code true} if the test is <em>enabled</em> in the current
 * environment or if the supplied {@code ifProfileValue} is
 * {@code null}
 */
private static boolean isTestEnabledInThisEnvironment(ProfileValueSource profileValueSource, IfProfileValue ifProfileValue) {
    if (ifProfileValue == null) {
        return true;
    }
    String environmentValue = profileValueSource.get(ifProfileValue.name());
    String[] annotatedValues = ifProfileValue.values();
    if (StringUtils.hasLength(ifProfileValue.value())) {
        if (annotatedValues.length > 0) {
            throw new IllegalArgumentException("Setting both the 'value' and 'values' attributes " + "of @IfProfileValue is not allowed: choose one or the other.");
        }
        annotatedValues = new String[] { ifProfileValue.value() };
    }
    for (String value : annotatedValues) {
        if (ObjectUtils.nullSafeEquals(value, environmentValue)) {
            return true;
        }
    }
    return false;
}

19 Source : PropertyBatchUpdateException.java
with Apache License 2.0
from langtianya

/**
 * Return the exception for this field, or {@code null} if there isn't any.
 */
public PropertyAccessException getPropertyAccessException(String propertyName) {
    for (PropertyAccessException pae : this.propertyAccessExceptions) {
        if (ObjectUtils.nullSafeEquals(propertyName, pae.getPropertyName())) {
            return pae;
        }
    }
    return null;
}

19 Source : LimitedResourceSourcePointcut.java
with Apache License 2.0
from jjj124

public boolean equals(Object other) {
    if (this == other) {
        return true;
    } else if (!(other instanceof LimitedResourceSourcePointcut)) {
        return false;
    } else {
        LimitedResourceSourcePointcut otherPc = (LimitedResourceSourcePointcut) other;
        return ObjectUtils.nullSafeEquals(this.getLimitedResourceSource(), otherPc.getLimitedResourceSource());
    }
}

19 Source : FragmentIoTests.java
with Apache License 2.0
from eclipse

public void testNoPrefixMeansBundlePrefixOnFiles() throws Exception {
    Resource[] wPrefix = patternLoader.getResources("osgibundle:**/*.res");
    Resource[] woPrefix = patternLoader.getResources("**/*.res");
    replacedertTrue(ObjectUtils.nullSafeEquals(wPrefix, woPrefix));
}

19 Source : FragmentIoTests.java
with Apache License 2.0
from eclipse

public void testNoPrefixMeansBundlePrefixOnClreplacedes() throws Exception {
    Resource[] wPrefix = patternLoader.getResources("osgibundle:**/*.clreplaced");
    Resource[] woPrefix = patternLoader.getResources("**/*.clreplaced");
    replacedertTrue(ObjectUtils.nullSafeEquals(wPrefix, woPrefix));
}

19 Source : ReferenceAnnotationBeanPostProcessor.java
with Apache License 2.0
from boomblog

private static boolean nullSafeEquals(Object first, Object another) {
    return ObjectUtils.nullSafeEquals(first, another);
}

18 Source : InMemoryCustomerRepository.java
with Apache License 2.0
from yuanmabiji

@Override
public Customer findOne(Long id) {
    for (Customer customer : this.customers) {
        if (ObjectUtils.nullSafeEquals(customer.getId(), id)) {
            return customer;
        }
    }
    return null;
}

18 Source : RepositoryConfiguration.java
with Apache License 2.0
from yuanmabiji

@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }
    if (obj == null) {
        return false;
    }
    if (getClreplaced() != obj.getClreplaced()) {
        return false;
    }
    RepositoryConfiguration other = (RepositoryConfiguration) obj;
    return ObjectUtils.nullSafeEquals(this.name, other.name);
}

18 Source : ConditionMessage.java
with Apache License 2.0
from yuanmabiji

@Override
public boolean equals(Object obj) {
    if (obj == null || !ConditionMessage.clreplaced.isInstance(obj)) {
        return false;
    }
    if (obj == this) {
        return true;
    }
    return ObjectUtils.nullSafeEquals(((ConditionMessage) obj).message, this.message);
}

18 Source : Status.java
with Apache License 2.0
from yuanmabiji

@Override
public boolean equals(Object obj) {
    if (obj == this) {
        return true;
    }
    if (obj != null && obj instanceof Status) {
        return ObjectUtils.nullSafeEquals(this.code, ((Status) obj).code);
    }
    return false;
}

18 Source : ApplicationPid.java
with Apache License 2.0
from yuanmabiji

@Override
public boolean equals(Object obj) {
    if (obj == this) {
        return true;
    }
    if (obj != null && obj instanceof ApplicationPid) {
        return ObjectUtils.nullSafeEquals(this.pid, ((ApplicationPid) obj).pid);
    }
    return false;
}

18 Source : OriginTrackedValue.java
with Apache License 2.0
from yuanmabiji

@Override
public boolean equals(Object obj) {
    if (obj == null || obj.getClreplaced() != getClreplaced()) {
        return false;
    }
    return ObjectUtils.nullSafeEquals(this.value, ((OriginTrackedValue) obj).value);
}

18 Source : BindResult.java
with Apache License 2.0
from yuanmabiji

@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }
    if (obj == null || getClreplaced() != obj.getClreplaced()) {
        return false;
    }
    return ObjectUtils.nullSafeEquals(this.value, ((BindResult<?>) obj).value);
}

18 Source : AbstractWebSocketMessage.java
with MIT License
from Vip-Augus

@Override
public boolean equals(Object other) {
    if (this == other) {
        return true;
    }
    if (!(other instanceof AbstractWebSocketMessage)) {
        return false;
    }
    AbstractWebSocketMessage<?> otherMessage = (AbstractWebSocketMessage<?>) other;
    return ObjectUtils.nullSafeEquals(this.payload, otherMessage.payload);
}

18 Source : ResponseEntity.java
with MIT License
from Vip-Augus

@Override
public boolean equals(@Nullable Object other) {
    if (this == other) {
        return true;
    }
    if (!super.equals(other)) {
        return false;
    }
    ResponseEnreplacedy<?> otherEnreplacedy = (ResponseEnreplacedy<?>) other;
    return ObjectUtils.nullSafeEquals(this.status, otherEnreplacedy.status);
}

18 Source : TransactionAttributeSourcePointcut.java
with MIT License
from Vip-Augus

@Override
public boolean equals(Object other) {
    if (this == other) {
        return true;
    }
    if (!(other instanceof TransactionAttributeSourcePointcut)) {
        return false;
    }
    TransactionAttributeSourcePointcut otherPc = (TransactionAttributeSourcePointcut) other;
    return ObjectUtils.nullSafeEquals(getTransactionAttributeSource(), otherPc.getTransactionAttributeSource());
}

18 Source : MockHttpServletRequestBuilder.java
with MIT License
from Vip-Augus

private boolean containsCookie(Cookie cookie) {
    for (Cookie cookieToCheck : this.cookies) {
        if (ObjectUtils.nullSafeEquals(cookieToCheck.getName(), cookie.getName())) {
            return true;
        }
    }
    return false;
}

18 Source : ModelAndViewAssert.java
with MIT License
from Vip-Augus

/**
 * Check to see if the view name in the ModelAndView matches the given
 * {@code expectedName}.
 * @param mav the ModelAndView to test against (never {@code null})
 * @param expectedName the name of the model value
 */
public static void replacedertViewName(ModelAndView mav, String expectedName) {
    replacedertTrue("View name is not equal to '" + expectedName + "' but was '" + mav.getViewName() + "'", ObjectUtils.nullSafeEquals(expectedName, mav.getViewName()));
}

18 Source : ProfileValueUtils.java
with MIT License
from Vip-Augus

/**
 * Determine if the {@code value} (or one of the {@code values})
 * in the supplied {@link IfProfileValue @IfProfileValue} annotation is
 * <em>enabled</em> in the current environment.
 * @param profileValueSource the ProfileValueSource to use to determine if
 * the test is enabled
 * @param ifProfileValue the annotation to introspect; may be
 * {@code null}
 * @return {@code true} if the test is <em>enabled</em> in the current
 * environment or if the supplied {@code ifProfileValue} is
 * {@code null}
 */
private static boolean isTestEnabledInThisEnvironment(ProfileValueSource profileValueSource, @Nullable IfProfileValue ifProfileValue) {
    if (ifProfileValue == null) {
        return true;
    }
    String environmentValue = profileValueSource.get(ifProfileValue.name());
    String[] annotatedValues = ifProfileValue.values();
    if (StringUtils.hasLength(ifProfileValue.value())) {
        replacedert.isTrue(annotatedValues.length == 0, () -> "Setting both the 'value' and 'values' attributes " + "of @IfProfileValue is not allowed: choose one or the other.");
        annotatedValues = new String[] { ifProfileValue.value() };
    }
    for (String value : annotatedValues) {
        if (ObjectUtils.nullSafeEquals(value, environmentValue)) {
            return true;
        }
    }
    return false;
}

18 Source : TypeDescriptor.java
with MIT License
from Vip-Augus

@Override
public boolean equals(Object other) {
    if (this == other) {
        return true;
    }
    if (!(other instanceof TypeDescriptor)) {
        return false;
    }
    TypeDescriptor otherDesc = (TypeDescriptor) other;
    if (getType() != otherDesc.getType()) {
        return false;
    }
    if (!annotationsMatch(otherDesc)) {
        return false;
    }
    if (isCollection() || isArray()) {
        return ObjectUtils.nullSafeEquals(getElementTypeDescriptor(), otherDesc.getElementTypeDescriptor());
    } else if (isMap()) {
        return (ObjectUtils.nullSafeEquals(getMapKeyTypeDescriptor(), otherDesc.getMapKeyTypeDescriptor()) && ObjectUtils.nullSafeEquals(getMapValueTypeDescriptor(), otherDesc.getMapValueTypeDescriptor()));
    } else {
        return true;
    }
}

18 Source : JCacheOperationSourcePointcut.java
with MIT License
from Vip-Augus

@Override
public boolean equals(Object other) {
    if (this == other) {
        return true;
    }
    if (!(other instanceof JCacheOperationSourcePointcut)) {
        return false;
    }
    JCacheOperationSourcePointcut otherPc = (JCacheOperationSourcePointcut) other;
    return ObjectUtils.nullSafeEquals(getCacheOperationSource(), otherPc.getCacheOperationSource());
}

18 Source : TestEntity.java
with MIT License
from Vip-Augus

@Override
public boolean equals(Object obj) {
    if (obj == this) {
        return true;
    }
    if (obj == null) {
        return false;
    }
    if (obj instanceof TestEnreplacedy) {
        return ObjectUtils.nullSafeEquals(this.id, ((TestEnreplacedy) obj).id);
    }
    return false;
}

18 Source : CacheOperationSourcePointcut.java
with MIT License
from Vip-Augus

@Override
public boolean equals(Object other) {
    if (this == other) {
        return true;
    }
    if (!(other instanceof CacheOperationSourcePointcut)) {
        return false;
    }
    CacheOperationSourcePointcut otherPc = (CacheOperationSourcePointcut) other;
    return ObjectUtils.nullSafeEquals(getCacheOperationSource(), otherPc.getCacheOperationSource());
}

18 Source : AbstractWebSocketMessage.java
with Apache License 2.0
from SourceHot

@Override
public boolean equals(@Nullable Object other) {
    if (this == other) {
        return true;
    }
    if (!(other instanceof AbstractWebSocketMessage)) {
        return false;
    }
    AbstractWebSocketMessage<?> otherMessage = (AbstractWebSocketMessage<?>) other;
    return ObjectUtils.nullSafeEquals(this.payload, otherMessage.payload);
}

18 Source : TransactionAttributeSourcePointcut.java
with Apache License 2.0
from SourceHot

@Override
public boolean equals(@Nullable Object other) {
    if (this == other) {
        return true;
    }
    if (!(other instanceof TransactionAttributeSourcePointcut)) {
        return false;
    }
    TransactionAttributeSourcePointcut otherPc = (TransactionAttributeSourcePointcut) other;
    return ObjectUtils.nullSafeEquals(getTransactionAttributeSource(), otherPc.getTransactionAttributeSource());
}

18 Source : TypeDescriptor.java
with Apache License 2.0
from SourceHot

@Override
public boolean equals(@Nullable Object other) {
    if (this == other) {
        return true;
    }
    if (!(other instanceof TypeDescriptor)) {
        return false;
    }
    TypeDescriptor otherDesc = (TypeDescriptor) other;
    if (getType() != otherDesc.getType()) {
        return false;
    }
    if (!annotationsMatch(otherDesc)) {
        return false;
    }
    if (isCollection() || isArray()) {
        return ObjectUtils.nullSafeEquals(getElementTypeDescriptor(), otherDesc.getElementTypeDescriptor());
    } else if (isMap()) {
        return (ObjectUtils.nullSafeEquals(getMapKeyTypeDescriptor(), otherDesc.getMapKeyTypeDescriptor()) && ObjectUtils.nullSafeEquals(getMapValueTypeDescriptor(), otherDesc.getMapValueTypeDescriptor()));
    } else {
        return true;
    }
}

18 Source : RepeatableContainers.java
with Apache License 2.0
from SourceHot

@Override
public boolean equals(@Nullable Object other) {
    if (other == this) {
        return true;
    }
    if (other == null || getClreplaced() != other.getClreplaced()) {
        return false;
    }
    return ObjectUtils.nullSafeEquals(this.parent, ((RepeatableContainers) other).parent);
}

18 Source : JCacheOperationSourcePointcut.java
with Apache License 2.0
from SourceHot

@Override
public boolean equals(@Nullable Object other) {
    if (this == other) {
        return true;
    }
    if (!(other instanceof JCacheOperationSourcePointcut)) {
        return false;
    }
    JCacheOperationSourcePointcut otherPc = (JCacheOperationSourcePointcut) other;
    return ObjectUtils.nullSafeEquals(getCacheOperationSource(), otherPc.getCacheOperationSource());
}

18 Source : CacheOperationSourcePointcut.java
with Apache License 2.0
from SourceHot

@Override
public boolean equals(@Nullable Object other) {
    if (this == other) {
        return true;
    }
    if (!(other instanceof CacheOperationSourcePointcut)) {
        return false;
    }
    CacheOperationSourcePointcut otherPc = (CacheOperationSourcePointcut) other;
    return ObjectUtils.nullSafeEquals(getCacheOperationSource(), otherPc.getCacheOperationSource());
}

18 Source : Book.java
with Apache License 2.0
from micronaut-projects

/*
	 * (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
@Override
public boolean equals(Object obj) {
    if (!(obj instanceof Book)) {
        return false;
    }
    return ObjectUtils.nullSafeEquals(id, ((Book) obj).id);
}

18 Source : ResponseEntity.java
with Apache License 2.0
from langtianya

@Override
public boolean equals(Object other) {
    if (this == other) {
        return true;
    }
    if (!super.equals(other)) {
        return false;
    }
    ResponseEnreplacedy<?> otherEnreplacedy = (ResponseEnreplacedy<?>) other;
    return ObjectUtils.nullSafeEquals(this.statusCode, otherEnreplacedy.statusCode);
}

18 Source : ModelAndViewAssert.java
with Apache License 2.0
from langtianya

/**
 * Check to see if the view name in the ModelAndView matches the given
 * {@code expectedName}.
 *
 * @param mav ModelAndView to test against (never {@code null})
 * @param expectedName the name of the model value
 */
public static void replacedertViewName(ModelAndView mav, String expectedName) {
    replacedertTrue("ModelAndView is null", mav != null);
    replacedertTrue("View name is not equal to '" + expectedName + "' but was '" + mav.getViewName() + "'", ObjectUtils.nullSafeEquals(expectedName, mav.getViewName()));
}

17 Source : SessionStoreMappings.java
with Apache License 2.0
from yuanmabiji

public static StoreType getType(WebApplicationType webApplicationType, String configurationClreplaced) {
    return MAPPINGS.entrySet().stream().filter((entry) -> ObjectUtils.nullSafeEquals(configurationClreplaced, entry.getValue().getConfiguration(webApplicationType))).map(Map.Entry::getKey).findFirst().orElseThrow(() -> new IllegalStateException("Unknown configuration clreplaced " + configurationClreplaced));
}

17 Source : SystemEnvironmentOrigin.java
with Apache License 2.0
from yuanmabiji

@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }
    if (obj == null || getClreplaced() != obj.getClreplaced()) {
        return false;
    }
    SystemEnvironmentOrigin other = (SystemEnvironmentOrigin) obj;
    return ObjectUtils.nullSafeEquals(this.property, other.property);
}

17 Source : SystemConfig.java
with GNU General Public License v3.0
from wehotel

@NacosValue(value = "${log.headers:x}", autoRefreshed = true)
public void setLogHeaders(String logHeaders) {
    if (ObjectUtils.nullSafeEquals(this.logHeaders, logHeaders)) {
        return;
    }
    log.info("log.headers old: " + this.logHeaders + ", new: " + logHeaders);
    this.updateLogHeaders(logHeaders);
}

17 Source : SelectedValueComparator.java
with MIT License
from Vip-Augus

private static boolean exhaustiveCompare(@Nullable Object boundValue, @Nullable Object candidate, @Nullable PropertyEditor editor, @Nullable Map<PropertyEditor, Object> convertedValueCache) {
    String candidateDisplayString = ValueFormatter.getDisplayString(candidate, editor, false);
    if (boundValue != null && boundValue.getClreplaced().isEnum()) {
        Enum<?> boundEnum = (Enum<?>) boundValue;
        String enumCodereplacedtring = ObjectUtils.getDisplayString(boundEnum.name());
        if (enumCodereplacedtring.equals(candidateDisplayString)) {
            return true;
        }
        String enumLabelreplacedtring = ObjectUtils.getDisplayString(boundEnum.toString());
        if (enumLabelreplacedtring.equals(candidateDisplayString)) {
            return true;
        }
    } else if (ObjectUtils.getDisplayString(boundValue).equals(candidateDisplayString)) {
        return true;
    }
    if (editor != null && candidate instanceof String) {
        // Try PE-based comparison (PE should *not* be allowed to escape creating thread)
        String candidatereplacedtring = (String) candidate;
        Object candidateAsValue;
        if (convertedValueCache != null && convertedValueCache.containsKey(editor)) {
            candidateAsValue = convertedValueCache.get(editor);
        } else {
            editor.setAsText(candidatereplacedtring);
            candidateAsValue = editor.getValue();
            if (convertedValueCache != null) {
                convertedValueCache.put(editor, candidateAsValue);
            }
        }
        if (ObjectUtils.nullSafeEquals(boundValue, candidateAsValue)) {
            return true;
        }
    }
    return false;
}

See More Examples