Ejemplo n.º 1
0
  /** @return a collection of message objects */
  public Collection<Message> getCollection() {
    Collection<Message> messages = new ArrayList<>();

    for (Message message : messageData.getCollection()) messages.add(this.get(message.getId()));

    return messages;
  }
Ejemplo n.º 2
0
  /**
   * Updates a message using a message object
   *
   * @param message the message object to update
   * @return true if the message was updated, else false
   */
  @Override
  public boolean update(Message message) {
    Boolean success = true;

    try {
      this.messageData.update(message.getId(), message);
    } catch (Exception e) {
      success = false;
    }

    return success;
  }
Ejemplo n.º 3
0
 /**
  * Deletes a message using a object
  *
  * @see MessageDao#delete(Object)
  * @param message the message object constructed by the application
  * @return true if the message was deleted, else false
  */
 @Override
 public boolean delete(Message message) {
   return this.delete(message.getId());
 }