private boolean skipEncoding(Object source) { return isTypeExcluded(source.getClass()); }
@Override public Object toStorage(Object content) { try { return skipEncoding(content) ? content : marshall(content); } catch (IOException | InterruptedException e) { throw new CacheException(e); } }
@Override public Object fromStorage(Object stored) { try { if (isTypeExcluded(stored.getClass())) { return stored; } return stored instanceof byte[] ? marshaller.objectFromByteBuffer((byte[]) stored) : stored; } catch (IOException | ClassNotFoundException e) { throw new CacheException(e); } }