Package net.cloudcodex.shared.dto.msg

Examples of net.cloudcodex.shared.dto.msg.MessageDTO


    final String introduction = scene.getIntroduction();
    if(introduction != null) {
      if(dto.getMessages() == null) {
        dto.setMessages(new ArrayList<MessageDTO>());
      }
      final MessageDTO messageDTO = new MessageDTO();
      messageDTO.setId(null);
      messageDTO.setAction(null);
      messageDTO.setAuthor(null);
      messageDTO.setContent(introduction);
      messageDTO.setIndex(0);
      messageDTO.setType(null);
      dto.getMessages().add(0, messageDTO);
    }
    dto.setTimestamp(scene.getTimestamp());
   
    if(viewCharacterKey != null) {
View Full Code Here


  /**
   * Map a {@link SceneSDO} to a {@link MessageDTO}.
   */
  public static MessageDTO mapMessage(Message message) {
   
    final MessageDTO dto = new MessageDTO();
    dto.setId(message.getKey().getId());
    dto.setType(MessageType.getMessageType(message.getType()));
    dto.setAction(MessageAction.getMessageAction(message.getAction()));
    dto.setIndex(message.getIndex() == null ? 0 : message.getIndex());
    if(Boolean.TRUE.equals(message.getDeleted())) {
      dto.setDeleted(true);
    } else {
      dto.setContent(message.getContent());
      dto.setDices(message.getDices());
    }

    final Key author = message.getAuthor();
    dto.setAuthor(author == null ? null : author.getId());
   
    return dto;
  }
View Full Code Here

      return null;
    }
   
    final List<MessageDTO> dtos = new ArrayList<MessageDTO>();
    for(Message message : messages) {
      final MessageDTO dto = mapMessage(message);
      if(dto != null) {
        dtos.add(dto);
      }
    }
   
View Full Code Here

TOP

Related Classes of net.cloudcodex.shared.dto.msg.MessageDTO

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.