Package com.wesabe.api.accounts.presenters

Source Code of com.wesabe.api.accounts.presenters.AttachmentPresenter

package com.wesabe.api.accounts.presenters;

import com.wesabe.api.accounts.entities.Attachment;
import com.wesabe.xmlson.XmlsonObject;

/**
* A presenter for {@link Attachment} instances.
*
* @author coda
*
*/
public class AttachmentPresenter {
  public XmlsonObject present(Attachment attachment) {
    final XmlsonObject root = new XmlsonObject("attachment");
    root.addProperty("guid", attachment.getGuid());
    root.addProperty("filename", attachment.getFilename());
    root.addProperty("content-type", attachment.getContentType());
    root.addProperty("size", attachment.getSize());
    root.addProperty("description", attachment.getDescription());
    return root;
  }
}
TOP

Related Classes of com.wesabe.api.accounts.presenters.AttachmentPresenter

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.