Package com.changestuffs.shared.dto

Examples of com.changestuffs.shared.dto.MessageResponse


@Singleton
public class DtoToJson {

  public String getJson(String body, String from, MessageType type){
    MyAutoBeanFactory beanFactory = AutoBeanFactorySource.create(MyAutoBeanFactory.class);
    MessageResponse response = new MessageResponse();
    response.setFrom(from);
    response.setMessage(body);
    response.setMessageType(type);
    AutoBean<IMessageResponse> bean = beanFactory.create(IMessageResponse.class, response);
    String json = AutoBeanCodex.encode(bean).getPayload();
    return json;
  }
View Full Code Here


  }
 
  private List<IMessageResponse> getIMessageResponseByMessages(List<Message> conversation){
    List<IMessageResponse> responses = new LinkedList<IMessageResponse>();
    for(Message message : conversation){
      MessageResponse response = new MessageResponse();
      response.setFrom(getSender(message));
      response.setMessage(message.getBody());
      responses.add(response);
      log.info("Converting "+message+" to "+response);
    }
    return responses;
  }
View Full Code Here

            GWT.log("Error doing SendMessage", caught);
          }

          @Override
          public void onSuccess(SendMessageResult result) {
            MessageResponse response = new MessageResponse();
            response.setFrom(user.getEmail());
            response.setMessage(message);
            addConversation(contact, response);
            getView().appendMessage(contact, response);
          }
        });
  }
View Full Code Here

TOP

Related Classes of com.changestuffs.shared.dto.MessageResponse

Copyright © 2018 www.massapicom. 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.