class Content implements Payload {

  public static void extractFromAsset(final Asset asset,
                                      final Iterable<HashAlgorithm> hashAlgorithms,
                                      final AttributesMap contentAttributes)
  {
    checkNotNull(asset);
    checkNotNull(hashAlgorithms);
    final NestedAttributesMap assetAttributes = asset.attributes().child(CONTENT);
    final DateTime lastModified = toDateTime(assetAttributes.get(P_LAST_MODIFIED, Date.class));
    final String etag = assetAttributes.get(P_ETAG, String.class);

    final Map<HashAlgorithm, HashCode> checksums = asset.getChecksums(hashAlgorithms);

    contentAttributes.set(Asset.class, asset);
    contentAttributes.set(Content.CONTENT_LAST_MODIFIED, lastModified);
    contentAttributes.set(Content.CONTENT_ETAG, etag);
    contentAttributes.set(Content.CONTENT_HASH_CODES_MAP, checksums);
    contentAttributes.set(CacheInfo.class, CacheInfo.extractFromAsset(asset));
  }

  public  Content(final Payload payload);
  protected  Content(final Payload payload, final AttributesMap attributes);

}