package at.fhj.swd14.pse.like;

import java.io.Serializable;

import at.fhj.swd14.pse.message.MessageDto;
import at.fhj.swd14.pse.user.UserDto;
/**
 * Data transfer object for a like of a message.
 * @author Thomas
 *
 */
public class MessageLikeDto implements Serializable {

	private static final long serialVersionUID = 1L;
	
	private UserDto liker;
    private MessageDto likedMessage;
    /**
     * Construct a new like for a message.
     * @param liker The user, who likes the message.
     * @param message The message, which is liked.
     */
    public MessageLikeDto(UserDto liker,MessageDto message) {
    	this.liker = liker;
    	this.likedMessage = message;
    }
    
    /**
     * Returns the liker of a message.
     * @return The liker of a message.
     */
    public UserDto getLiker() {
		return this.liker;
	}
    /**
     * Sets the liker of a message.
     * @param user The user who likes the message.
     */
    public void setLiker(UserDto user) {
    	this.liker = user;   	
    }
    /**
     * Returns the liked message.
     * @return The liked message.
     */
    public MessageDto getLikedMessage() {
    	return this.likedMessage;
    }
    /**
     * Sets the liked message.
     * @param message The liked message.
     */
    public void setLikedMessage(MessageDto message) {
    	this.likedMessage = message;
    }
    @Override
    public String toString() {
    	StringBuffer sb = new StringBuffer();
    	sb.append("MessageLikeDto");
    	sb.append("   user: " + this.liker.getId());
    	sb.append("   message: " + this.likedMessage.getId());
    	    	
    	return sb.toString();
    }
}

@@ -137,16 +137,17 @@
 serDto;%0A
+%0A
 /**%0A * D
@@ -191,16 +191,19 @@
 essage.%0A
+ *%0A
  * @auth
@@ -212,19 +212,16 @@
  Thomas%0A
- *%0A
  */%0Apubl
@@ -271,17 +271,20 @@
 able %7B%0A%0A
-%09
+    
 private 
@@ -328,11 +328,13 @@
 1L;%0A
-%09%0A%09
+%0A    
 priv
@@ -385,24 +385,25 @@
 kedMessage;%0A
+%0A
     /**%0A    
@@ -433,32 +433,39 @@
  for a message.%0A
+     *%0A
      * @param li
@@ -468,16 +468,18 @@
 m liker 
+  
 The user
@@ -602,16 +602,17 @@
 o liker,
+ 
 MessageD
@@ -621,33 +621,36 @@
  message) %7B%0A    
-%09
+    
 this.liker = lik
@@ -653,25 +653,28 @@
  liker;%0A    
-%09
+    
 this.likedMe
@@ -696,20 +696,16 @@
 ;%0A    %7D%0A
-    
 %0A    /**
@@ -736,32 +736,39 @@
 r of a message.%0A
+     *%0A
      * @return T
@@ -834,10 +834,16 @@
 ) %7B%0A
-%09%09
+        
 retu
@@ -861,10 +861,14 @@
 er;%0A
-%09%7D
+    %7D%0A
 %0A   
@@ -900,32 +900,39 @@
 r of a message.%0A
+     *%0A
      * @param us
@@ -1011,33 +1011,36 @@
 Dto user) %7B%0A    
-%09
+    
 this.liker = use
@@ -1045,19 +1045,16 @@
 ser;
-   %09
 %0A    %7D%0A
+%0A
     
@@ -1083,32 +1083,39 @@
  liked message.%0A
+     *%0A
      * @return T
@@ -1182,25 +1182,28 @@
 age() %7B%0A    
-%09
+    
 return this.
@@ -1218,24 +1218,25 @@
 sage;%0A    %7D%0A
+%0A
     /**%0A    
@@ -1254,32 +1254,39 @@
  liked message.%0A
+     *%0A
      * @param me
@@ -1376,17 +1376,20 @@
 ) %7B%0A    
-%09
+    
 this.lik
@@ -1415,16 +1415,17 @@
 ;%0A    %7D%0A
+%0A
     @Ove
@@ -1469,96 +1469,54 @@
     
-%09StringBuffer sb = new StringBuffer();%0A    %09sb.append(%22MessageLikeDto%22);%0A    %09sb.append(
+    return %22MessageLikeDto%22 +%0A                
 %22   
@@ -1547,26 +1547,27 @@
 Id()
-);
+ +
 %0A    
-%09sb.append(
+            
 %22   
@@ -1608,47 +1608,8 @@
 Id()
-);%0A    %09    %09%0A    %09return sb.toString()
 ;%0A  

remove unneccessary string buffer