// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package com.fasterxml.jackson.databind.ser.impl; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.util.TypeKey; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Set; public final class ReadOnlyClassToSerializerMap { private static final class Bucket { protected final Class _class; protected final boolean _isTyped; protected final JavaType _type; public final Bucket next; public final JsonSerializer value; public boolean matchesTyped(JavaType javatype) { return _isTyped && javatype.equals(_type); } public boolean matchesTyped(Class class1) { return _class == class1 && _isTyped; } public boolean matchesUntyped(JavaType javatype) { return !_isTyped && javatype.equals(_type); } public boolean matchesUntyped(Class class1) { return _class == class1 && !_isTyped; } public Bucket(Bucket bucket, TypeKey typekey, JsonSerializer jsonserializer) { next = bucket; value = jsonserializer; _isTyped = typekey.isTyped(); _class = typekey.getRawType(); _type = typekey.getType(); } } private final Bucket _buckets[]; private final int _mask; private final int _size; public ReadOnlyClassToSerializerMap(Map map) { int i = findSize(map.size()); _size = i; _mask = i - 1; Bucket abucket[] = new Bucket[i]; for (map = map.entrySet().iterator(); map.hasNext();) { java.util.Map.Entry entry = (java.util.Map.Entry)map.next(); TypeKey typekey = (TypeKey)entry.getKey(); int j = typekey.hashCode() & _mask; abucket[j] = new Bucket(abucket[j], typekey, (JsonSerializer)entry.getValue()); } _buckets = abucket; } private static final int findSize(int i) { int j; if (i <= 64) { i += i; } else { i += i >> 2; } for (j = 8; j < i; j += j) { } return j; } public static ReadOnlyClassToSerializerMap from(HashMap hashmap) { return new ReadOnlyClassToSerializerMap(hashmap); } public int size() { return _size; } public JsonSerializer typedValueSerializer(JavaType javatype) { Bucket bucket1 = _buckets[TypeKey.typedHash(javatype) & _mask]; if (bucket1 != null) goto _L2; else goto _L1 _L1: return null; _L2: Bucket bucket = bucket1; if (bucket1.matchesTyped(javatype)) { return bucket1.value; } do { Bucket bucket2 = bucket.next; if (bucket2 == null) { continue; /* Loop/switch isn't completed */ } bucket = bucket2; if (bucket2.matchesTyped(javatype)) { return bucket2.value; } } while (true); if (true) goto _L1; else goto _L3 _L3: } public JsonSerializer typedValueSerializer(Class class1) { Bucket bucket1 = _buckets[TypeKey.typedHash(class1) & _mask]; if (bucket1 != null) goto _L2; else goto _L1 _L1: return null; _L2: Bucket bucket = bucket1; if (bucket1.matchesTyped(class1)) { return bucket1.value; } do { Bucket bucket2 = bucket.next; if (bucket2 == null) { continue; /* Loop/switch isn't completed */ } bucket = bucket2; if (bucket2.matchesTyped(class1)) { return bucket2.value; } } while (true); if (true) goto _L1; else goto _L3 _L3: } public JsonSerializer untypedValueSerializer(JavaType javatype) { Bucket bucket1 = _buckets[TypeKey.untypedHash(javatype) & _mask]; if (bucket1 != null) goto _L2; else goto _L1 _L1: return null; _L2: Bucket bucket = bucket1; if (bucket1.matchesUntyped(javatype)) { return bucket1.value; } do { Bucket bucket2 = bucket.next; if (bucket2 == null) { continue; /* Loop/switch isn't completed */ } bucket = bucket2; if (bucket2.matchesUntyped(javatype)) { return bucket2.value; } } while (true); if (true) goto _L1; else goto _L3 _L3: } public JsonSerializer untypedValueSerializer(Class class1) { Bucket bucket1 = _buckets[TypeKey.untypedHash(class1) & _mask]; if (bucket1 != null) goto _L2; else goto _L1 _L1: return null; _L2: Bucket bucket = bucket1; if (bucket1.matchesUntyped(class1)) { return bucket1.value; } do { Bucket bucket2 = bucket.next; if (bucket2 == null) { continue; /* Loop/switch isn't completed */ } bucket = bucket2; if (bucket2.matchesUntyped(class1)) { return bucket2.value; } } while (true); if (true) goto _L1; else goto _L3 _L3: } }