All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.juli.logging.com.fasterxml.jackson.databind.type.IdentityEqualityType Maven / Gradle / Ivy

There is a newer version: 10.1.23
Show newest version
package org.apache.juli.logging.com.fasterxml.jackson.databind.type;

import org.apache.juli.logging.com.fasterxml.jackson.databind.JavaType;

/**
 * Internal abstract type representing {@link TypeBase} implementations which use reference equality.
 *
 * @since 2.15
 */
abstract class IdentityEqualityType extends TypeBase
{
    private static final long serialVersionUID = 1L;

    protected IdentityEqualityType(Class raw,
            TypeBindings bindings, JavaType superClass, JavaType[] superInts,
            int hash,
            Object valueHandler, Object typeHandler, boolean asStatic) {
        super(raw, bindings, superClass, superInts, hash, valueHandler, typeHandler, asStatic);
    }

    @Override
    public final boolean equals(Object o) {
        return o == this;
    }

    @Override
    public final int hashCode() {
        // The identity hashCode must be used otherwise all instances will have colliding hashCodes.
        return System.identityHashCode(this);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy