class UnwrapDataEntry extends DataEntry implements UnwrappedDataEntry {
    /** Cache object value context. Context is used for unwrapping objects. */
    private final CacheObjectValueContext cacheObjValCtx;

    /** Keep binary. This flag disables converting of non-primitive types (BinaryObjects). */
    private final boolean keepBinary;

    /**
     * @param cacheId Cache ID.
     * @param key Key.
     * @param val Value or null for delete operation.
     * @param op Operation.
     * @param nearXidVer Near transaction version.
     * @param writeVer Write version.
     * @param expireTime Expire time.
     * @param partId Partition ID.
     * @param partCnt Partition counter.
     * @param cacheObjValCtx cache object value context for unwrapping objects.
     * @param keepBinary disable unwrapping for non primitive objects, Binary Objects would be returned instead.
     * @param flags Flags.
     */
    public UnwrapDataEntry(
        final int cacheId,
        final KeyCacheObject key,
        final CacheObject val,
        final GridCacheOperation op,
        final GridCacheVersion nearXidVer,
        final GridCacheVersion writeVer,
        final long expireTime,
        final int partId,
        final long partCnt,
        final CacheObjectValueContext cacheObjValCtx,
        final boolean keepBinary,
        final byte flags) {
        super(cacheId, key, val, op, nearXidVer, writeVer, expireTime, partId, partCnt, flags);
        this.cacheObjValCtx = cacheObjValCtx;
        this.keepBinary = keepBinary;
    }

    /** {@inheritDoc} */
    @Override public Object unwrappedKey() {
        try {
            return unwrapKey(key, keepBinary, cacheObjValCtx);
        }
        catch (Exception e) {
            cacheObjValCtx.kernalContext().log(UnwrapDataEntry.class)
                .error("Unable to convert key [" + key + "]", e);

            return null;
        }
    }

    /** {@inheritDoc} */
    @Override public Object unwrappedValue() {<FILL_FUNCTION_BODY>}

    /** */
    public static Object unwrapKey(KeyCacheObject key, boolean keepBinary, CacheObjectValueContext cacheObjValCtx) {
        if (keepBinary && key instanceof BinaryObject)
            return key;

        Object unwrapped = key.value(cacheObjValCtx, false);

        if (unwrapped instanceof BinaryObject) {
            if (keepBinary)
                return unwrapped;

            unwrapped = ((BinaryObject)unwrapped).deserialize();
        }

        return unwrapped;
    }

    /** */
    public static Object unwrapValue(CacheObject val, boolean keepBinary, CacheObjectValueContext cacheObjValCtx) {
        if (val == null)
            return null;

        if (keepBinary && val instanceof BinaryObject)
            return val;

        return val.value(cacheObjValCtx, false);
    }

    /** {@inheritDoc} */
    @Override public String toString() {
        SB sb = new SB();

        sb.a(getClass().getSimpleName()).a('[');

        if (S.includeSensitive())
            sb.a("k = ").a(unwrappedKey()).a(", v = [ ").a(unwrappedValue()).a("], ");

        return sb.a("super = [").a(super.toString()).a("]]").toString();
    }
}

        try {
            return unwrapValue(val, keepBinary, cacheObjValCtx);
        }
        catch (Exception e) {
            cacheObjValCtx.kernalContext().log(UnwrapDataEntry.class)
                .error("Unable to convert value [" + value() + "]", e);
            return null;
        }
    
<methods>public void <init>(int, org.apache.ignite.internal.processors.cache.KeyCacheObject, org.apache.ignite.internal.processors.cache.CacheObject, org.apache.ignite.internal.processors.cache.GridCacheOperation, org.apache.ignite.internal.processors.cache.version.GridCacheVersion, org.apache.ignite.internal.processors.cache.version.GridCacheVersion, long, int, long, byte) ,public int cacheId() ,public long expireTime() ,public static byte flags(boolean) ,public static byte flags(boolean, boolean, boolean) ,public byte flags() ,public org.apache.ignite.internal.processors.cache.KeyCacheObject key() ,public org.apache.ignite.internal.processors.cache.version.GridCacheVersion nearXidVersion() ,public org.apache.ignite.internal.processors.cache.GridCacheOperation op() ,public long partitionCounter() ,public org.apache.ignite.internal.pagemem.wal.record.DataEntry partitionCounter(long) ,public int partitionId() ,public java.lang.String toString() ,public org.apache.ignite.internal.processors.cache.CacheObject value() ,public org.apache.ignite.internal.processors.cache.version.GridCacheVersion writeVersion() <variables>public static final byte EMPTY_FLAGS,public static final byte FROM_STORE_FLAG,public static final byte PRELOAD_FLAG,public static final byte PRIMARY_FLAG,protected int cacheId,protected long expireTime,protected byte flags,protected org.apache.ignite.internal.processors.cache.KeyCacheObject key,protected org.apache.ignite.internal.processors.cache.version.GridCacheVersion nearXidVer,protected org.apache.ignite.internal.processors.cache.GridCacheOperation op,protected long partCnt,protected int partId,protected org.apache.ignite.internal.processors.cache.CacheObject val,protected org.apache.ignite.internal.processors.cache.version.GridCacheVersion writeVer