public PathAttributes deserialize(final T serialized) {
        final Deserializer<T> dict = factory.create(serialized);
        final PathAttributes attributes = new PathAttributes();
        final String sizeObj = dict.stringForKey("Size");
        if(sizeObj != null) {
            attributes.setSize(Long.parseLong(sizeObj));
        }
        final String quotaObj = dict.stringForKey("Quota");
        if(quotaObj != null) {
            attributes.setQuota(new Quota.Space(attributes.getSize(), Long.parseLong(quotaObj)));
        }
        final String modifiedObj = dict.stringForKey("Modified");
        if(modifiedObj != null) {
            attributes.setModificationDate(Long.parseLong(modifiedObj));
        }
        final String createdObj = dict.stringForKey("Created");
        if(createdObj != null) {
            attributes.setCreationDate(Long.parseLong(createdObj));
        }
        final String revisionObj = dict.stringForKey("Revision");
        if(revisionObj != null) {
            attributes.setRevision(Long.parseLong(revisionObj));
        }
        final String etagObj = dict.stringForKey("ETag");
        if(etagObj != null) {
            attributes.setETag(etagObj);
        }
        final Object permissionObj = dict.objectForKey("Permission");
        if(permissionObj != null) {
            attributes.setPermission(new PermissionDictionary<>().deserialize(permissionObj));
        }
        attributes.setOwner(dict.stringForKey("Owner"));
        attributes.setGroup(dict.stringForKey("Group"));
        final Object aclObj = dict.objectForKey("Acl");
        if(aclObj != null) {
            attributes.setAcl(new AclDictionary<>().deserialize(aclObj));
        }
        if(dict.mapForKey("Link") != null) {
            final Map<String, String> link = dict.mapForKey("Link");
            attributes.setLink(new DescriptiveUrl(URI.create(link.get("Url")), DescriptiveUrl.Type.valueOf(link.get("Type"))));
        }
        else {
            final String linkObj = dict.stringForKey("Link");
            if(linkObj != null) {
                attributes.setLink(new DescriptiveUrl(URI.create(linkObj), DescriptiveUrl.Type.http));
            }
        }
        if(dict.mapForKey("Checksum") != null) {
            final Map<String, String> checksum = dict.mapForKey("Checksum");
            attributes.setChecksum(new Checksum(HashAlgorithm.valueOf(checksum.get("Algorithm")), checksum.get("Hash"), checksum.get("Base64")));
        }
        else {
            attributes.setChecksum(Checksum.parse(dict.stringForKey("Checksum")));
        }
        attributes.setVersionId(dict.stringForKey("Version"));
        attributes.setFileId(dict.stringForKey("File Id"));
        attributes.setDisplayname(dict.stringForKey("Display Name"));
        attributes.setLockId(dict.stringForKey("Lock Id"));
        final String duplicateObj = dict.stringForKey("Duplicate");
        if(duplicateObj != null) {
            attributes.setDuplicate(Boolean.parseBoolean(duplicateObj));
        }
        final String hiddenObj = dict.stringForKey("Hidden");
        if(hiddenObj != null) {
            attributes.setHidden(Boolean.parseBoolean(hiddenObj));
        }
        attributes.setMetadata(Collections.emptyMap());
        attributes.setRegion(dict.stringForKey("Region"));
        attributes.setStorageClass(dict.stringForKey("Storage Class"));
        final T vaultObj = dict.objectForKey("Vault");
        if(vaultObj != null) {
            attributes.setVault(new PathDictionary<>(factory).deserialize(vaultObj));
        }
        final Map<String, String> customObj = dict.mapForKey("Custom");
        if(customObj != null) {
            attributes.setCustom(customObj);
        }
        final String verdictObj = dict.stringForKey("Verdict");
        if(verdictObj != null) {
            attributes.setVerdict(PathAttributes.Verdict.valueOf(verdictObj));
        }
        return attributes;
    }
@Test
    public void testGetAsDictionary() {
        PathAttributes attributes = new PathAttributes();
        attributes.setSize(3L);
        attributes.setChecksum(Checksum.parse("da39a3ee5e6b4b0d3255bfef95601890afd80709"));
        attributes.setModificationDate(5343L);
        attributes.setLink(new DescriptiveUrl(URI.create("https://cyberduck.io/"), DescriptiveUrl.Type.signed));
        final PathAttributes deserialized = new PathAttributesDictionary<>().deserialize(attributes.serialize(SerializerFactory.get()));
        assertEquals(attributes, deserialized);
        assertEquals(attributes.hashCode(), deserialized.hashCode());
        assertEquals(attributes.getLink(), deserialized.getLink());
        assertEquals(attributes.getLink().getType(), deserialized.getLink().getType());
    }