All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.activitystream.aspects.AttachmentAspect Maven / Gradle / Ivy

package com.activitystream.aspects;

import com.activitystream.helpers.DateHelpers;

import java.util.Map;

public class AttachmentAspect extends AspectBase{
    public AttachmentAspect(String url) {
        this.aspectPropertyMap.put("attachment.url", new AspectProperty(IsRequired.True, url));
        this.aspectPropertyMap.put("attachment.fingerprint", new AspectProperty(IsRequired.False));
        this.aspectPropertyMap.put("attachment.filename", new AspectProperty(IsRequired.False));
        this.aspectPropertyMap.put("attachment.description", new AspectProperty(IsRequired.False));
        this.aspectPropertyMap.put("attachment.size", new AspectProperty(IsRequired.False));
        this.aspectPropertyMap.put("attachment.created", new AspectProperty(IsRequired.False));
        this.aspectPropertyMap.put("attachment.updated", new AspectProperty(IsRequired.False));
        this.aspectPropertyMap.put("attachment.metadata", new AspectProperty(IsRequired.False));
        this.aspectPropertyMap.put("attachment.properties", new AspectProperty(IsRequired.False));
    }

    public AttachmentAspect fingerprint(String fingerprint) {
        aspectPropertyMap.get("attachment.fingerprint").value = fingerprint;
        return this;
    }

    public AttachmentAspect filename(String filename) {
        aspectPropertyMap.get("attachment.filename").value = filename;
        return this;
    }

    public AttachmentAspect description(String description) {
        aspectPropertyMap.get("attachment.description").value = description;
        return this;
    }

    public AttachmentAspect size(Double size) {
        aspectPropertyMap.get("attachment.size").value = size;
        return this;
    }

    public AttachmentAspect created(String created) {
        DateHelpers.validateDateString(created);
        aspectPropertyMap.get("attachment.created").value = created;
        return this;
    }

    public AttachmentAspect updated(String updated) {
        DateHelpers.validateDateString(updated);
        aspectPropertyMap.get("attachment.updated").value = updated;
        return this;
    }

    public AttachmentAspect metadata(Map metadata) {
        aspectPropertyMap.get("attachment.metadata").value = metadata;
        return this;
    }

    public AttachmentAspect properties(Map properties) {
        aspectPropertyMap.get("attachment.properties").value = properties;
        return this;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy