class CacheKeyConfiguration implements Serializable {
    /** */
    private static final long serialVersionUID = 0L;

    /** Type name. */
    private String typeName;

    /** Affinity key field name. */
    private String affKeyFieldName;

    /**
     * Creates an empty cache key configuration that should be populated via setters.
     */
    public CacheKeyConfiguration() {
        // Convenience no-op constructor.
    }

    /**
     * @param keyCls Key class.
     */
    public CacheKeyConfiguration(Class keyCls) {
        typeName = keyCls.getName();

        for (; keyCls != Object.class && keyCls != null; keyCls = keyCls.getSuperclass()) {
            for (Field f : keyCls.getDeclaredFields()) {
                if (f.getAnnotation(AffinityKeyMapped.class) != null) {
                    affKeyFieldName = f.getName();

                    return;
                }
            }
        }
    }

    /**
     * Creates cache key configuration with given type name and affinity field name.
     *
     * @param typeName Type name.
     * @param affKeyFieldName Affinity field name.
     */
    public CacheKeyConfiguration(String typeName, String affKeyFieldName) {
        this.typeName = typeName;
        this.affKeyFieldName = affKeyFieldName;
    }

    /**
     * Sets type name for which affinity field name is being defined.
     *
     * @return Type name.
     */
    public String getTypeName() {
        return typeName;
    }

    /**
     * @param typeName Type name for which affinity field name is being defined.
     * @return {@code this} for chaining.
     */
    public CacheKeyConfiguration setTypeName(String typeName) {
        this.typeName = typeName;

        return this;
    }

    /**
     * Gets affinity key field name.
     *
     * @return Affinity key field name.
     */
    public String getAffinityKeyFieldName() {
        return affKeyFieldName;
    }

    /**
     * Sets affinity key field name.
     *
     * @param affKeyFieldName Affinity key field name.
     * @return {@code this} for chaining.
     */
    public CacheKeyConfiguration setAffinityKeyFieldName(String affKeyFieldName) {
        this.affKeyFieldName = affKeyFieldName;

        return this;
    }

    /** {@inheritDoc} */
    @Override public boolean equals(Object o) {<FILL_FUNCTION_BODY>}

    /** {@inheritDoc} */
    @Override public int hashCode() {
        int result = typeName != null ? typeName.hashCode() : 0;

        result = 31 * result + (affKeyFieldName != null ? affKeyFieldName.hashCode() : 0);

        return result;
    }

    /** {@inheritDoc} */
    @Override public String toString() {
        return S.toString(CacheKeyConfiguration.class, this);
    }
}

        if (this == o)
            return true;

        if (o == null || getClass() != o.getClass())
            return false;

        CacheKeyConfiguration that = (CacheKeyConfiguration)o;

        if (!Objects.equals(typeName, that.typeName))
            return false;

        return Objects.equals(affKeyFieldName, that.affKeyFieldName);
    
<no_super_class>