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

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

Go to download

For a description please see https://github.com/activitystream/as-sdk-java

There is a newer version: 0.5.8
Show newest version
package com.activitystream.aspects;

import com.activitystream.Aspect;

import java.util.*;

public class AttachmentsAspect implements Aspect {

    private List attachment = new ArrayList<>();

    public AttachmentsAspect(Attachment... attachments) {
        this.attachment.addAll(Arrays.asList(attachments));
    }

    public AttachmentsAspect add(Attachment... attachments) {
        this.attachment.addAll(Arrays.asList(attachments));
        return this;
    }

    @Override
    public void addToObject(Map jsonObject, Set processed) {
        List inv = new ArrayList();
        for (Attachment item : attachment) {
            if (item != null) inv.add(item.toJson());
        }
        jsonObject.put("attachments", inv);

    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy