package com.maxmind.db;

public final class CacheKey<T> {
    private final int offset;
    private final Class<T> cls;
    private final java.lang.reflect.Type type;

    CacheKey(int offset, Class<T> cls, java.lang.reflect.Type type) {
        this.offset = offset;
        this.cls = cls;
        this.type = type;
    }

    int getOffset() {
        return this.offset;
    }

    Class<T> getCls() {
        return this.cls;
    }

    java.lang.reflect.Type getType() {
        return this.type;
    }

    @Override
    public boolean equals(Object o) {
        if (o == null) {
            return false;
        }

        CacheKey other = (CacheKey) o;

        if (this.offset != other.offset) {
            return false;
        }

        if (this.cls == null) {
            if (other.cls != null) {
                return false;
            }
        } else if (!this.cls.equals(other.cls)) {
            return false;
        }

        if (this.type == null) {
            if (other.type != null) {
                return false;
            }
        } else if (!this.type.equals(other.type)) {
            return false;
        }

        return true;
    }

    @Override
    public int hashCode() {
        int result = offset;
        result = 31 * result + (cls == null ? 0 : cls.hashCode());
        result = 31 * result + (type == null ? 0 : type.hashCode());
        return result;
    }
}

@@ -978,28 +978,31 @@
             
-if (
+return 
 other.type !
@@ -1000,26 +1000,24 @@
 er.type 
-!
+=
 = null
-) %7B
+;
 %0A       
@@ -1009,32 +1009,34 @@
 = null;%0A        
+%7D%0A
         return f
@@ -1038,137 +1038,36 @@
 urn 
-false;%0A            %7D%0A        %7D else if (!this.type.equals(other.type)) %7B%0A            return false;%0A        %7D%0A%0A        return true
+this.type.equals(other.type)
 ;%0A  

Simplify equals code slightly