Package com.wesabe.api.accounts.presenters

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

package com.wesabe.api.accounts.presenters;

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

/**
* A presenter for {@link Account} instances where more information is needed
* than {@link AccountReferencePresenter}, but less than
* {@link AccountPresenter}.
*
* @author coda
*
*/
public class AccountBriefPresenter {
  public XmlsonObject present(Account account) {
    final XmlsonObject root = new XmlsonObject("account");
    root.addProperty("id", account.getRelativeId());
    root.addProperty("uri", String.format("/accounts/%d", account.getRelativeId()));
    root.addProperty("type", account.getAccountType().toString());
    return root;
  }
}
TOP

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

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.