com.fasterxml.jackson.annotation.ObjectIdGenerator.java Source code

Java tutorial

Introduction

Here is the source code for com.fasterxml.jackson.annotation.ObjectIdGenerator.java

Source

package com.fasterxml.jackson.annotation;

import java.io.Serializable;

public abstract class ObjectIdGenerator<T> implements Serializable {
    public abstract boolean canUseFor(ObjectIdGenerator<?> paramObjectIdGenerator);

    public abstract ObjectIdGenerator<T> forScope(Class<?> paramClass);

    public abstract T generateId(Object paramObject);

    public abstract Class<?> getScope();

    public abstract IdKey key(Object paramObject);

    public abstract ObjectIdGenerator<T> newForSerialization(Object paramObject);

    public static final class IdKey implements Serializable {
        private final int hashCode;
        private final Object key;
        private final Class<?> scope;
        private final Class<?> type;

        public IdKey(Class<?> paramClass1, Class<?> paramClass2, Object paramObject) {
            this.type = paramClass1;
            this.scope = paramClass2;
            this.key = paramObject;
            int i = paramObject.hashCode() + paramClass1.getName().hashCode();
            if (paramClass2 != null)
                i ^= paramClass2.getName().hashCode();
            this.hashCode = i;
        }

        public boolean equals(Object paramObject) {
            if (paramObject == this)
                ;
            IdKey localIdKey;
            do {
                return true;
                if (paramObject == null)
                    return false;
                if (paramObject.getClass() != getClass())
                    return false;
                localIdKey = (IdKey) paramObject;
            } while ((localIdKey.key.equals(this.key)) && (localIdKey.type == this.type)
                    && (localIdKey.scope == this.scope));
            return false;
        }

        public int hashCode() {
            return this.hashCode;
        }
    }
}

/* Location:           /Users/dantheman/src/fffffffffattttt/basis/classes_dex2jar.jar
 * Qualified Name:     com.fasterxml.jackson.annotation.ObjectIdGenerator
 * JD-Core Version:    0.6.2
 */