class Element implements Serializable, Cloneable {

    public final long getSerializedSize() {

        if (!isSerializable()) {
            return 0;
        }
        long size = 0;
        ByteArrayOutputStream bout = new ByteArrayOutputStream();
        ObjectOutputStream oos = null;
        try {
            oos = new ObjectOutputStream(bout);
            oos.writeObject(this);
            size = bout.size();
            return size;
        } catch (IOException e) {
            LOG.fine("Error measuring element size for element with key " + key + ". Cause was: " + e.getMessage());
        } finally {
            try {
                if (oos != null) {
                    oos.close();
                }
            } catch (Exception e) {
                LOG.severe("Error closing ObjectOutputStream");
            }
        }

        return size;
    }

    public  Element(Serializable key, Serializable value, long version);
    public  Element(Object key, Object value, long version);
    public  Element(Object key, Object value, long version,
                   long creationTime, long lastAccessTime,
                   long nextToLastAccessTime, long lastUpdateTime,
                   long hitCount);
    public  Element(Object key, Object value,
                   Boolean eternal, Integer timeToIdleSeconds, Integer timeToLiveSeconds);
    public  Element(Serializable key, Serializable value);
    public  Element(Object key, Object value);

}