package com.enseirb.telecom.s9.db;

import java.util.List;

import com.enseirb.telecom.s9.Friend;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

@JsonIgnoreProperties(ignoreUnknown=true)
public class RelationshipRepositoryObject {
	public RelationshipRepositoryObject(){
		
	}
	public RelationshipRepositoryObject(String userId, String email, String name, String surname, String pubKey, Boolean aprouve, Long unixTime, List<Integer> group) {
		super();
		this.userId = userId;
		this.email = email;
		this.name = name;
		this.surname = surname;
		this.pubKey = pubKey;
		this.aprouve = aprouve;
		this.unixTime = unixTime;
		this.group = group;
	}
	public RelationshipRepositoryObject(String userId, Friend friend) {
		this.userId = userId;
		this.email = friend.getEmail();
		this.name = friend.getName();
		this.surname = friend.getSurname();
		this.pubKey = friend.getPubKey();
		this.aprouve = friend.isAprouve();
		this.unixTime = friend.getUnixTime();
		this.group = friend.getGroupID();
		
	}
	String userId;
	String email;
    String name;
    String surname;
    String pubKey;
    Boolean aprouve;
    Long unixTime;
    List<Integer> group;
	public String getUserId() {
		return userId;
	}
	public void setUserId(String userId) {
		this.userId = userId;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getSurname() {
		return surname;
	}
	public void setSurname(String surname) {
		this.surname = surname;
	}
	public String getPubKey() {
		return pubKey;
	}
	public void setPubKey(String pubKey) {
		this.pubKey = pubKey;
	}
	public Boolean getAprouve() {
		return aprouve;
	}
	public void setAprouve(Boolean aprouve) {
		this.aprouve = aprouve;
	}
	public Long getUnixTime() {
		return unixTime;
	}
	public void setUnixTime(Long unixTime) {
		this.unixTime = unixTime;
	}
	public List<Integer> getGroup() {
		return group;
	}
	public void setGroup(List<Integer> group) {
		this.group = group;
	}
	public void toFriend() {
		Friend friend = new Friend();
		friend.setEmail(email);
		friend.setName(name);
		friend.setSurname(surname);
		friend.setPubKey(pubKey);
		friend.setUnixTime(unixTime);
		friend.setAprouve(aprouve);
		friend.getGroupID().addAll(group);
		
	}
}

@@ -52,17 +52,16 @@
 l.List;%0A
-%0A
 import c
@@ -82,22 +82,24 @@
 ecom.s9.
-Friend
+Relation
 ;%0Aimport
@@ -710,29 +710,33 @@
 userId, 
-Friend friend
+Relation relation
 ) %7B%0A%09%09th
@@ -770,22 +770,24 @@
 email = 
-friend
+relation
 .getEmai
@@ -801,30 +801,32 @@
 this.name = 
-friend
+relation
 .getName();%0A
@@ -838,30 +838,32 @@
 s.surname = 
-friend
+relation
 .getSurname(
@@ -881,22 +881,24 @@
 ubKey = 
-friend
+relation
 .getPubK
@@ -920,22 +920,24 @@
 rouve = 
-friend
+relation
 .isAprou
@@ -960,22 +960,24 @@
 xTime = 
-friend
+relation
 .getUnix
@@ -999,22 +999,24 @@
 group = 
-friend
+relation
 .getGrou
@@ -2139,59 +2139,69 @@
 d to
-Friend() %7B%0A%09%09Friend friend = new Friend();%0A%09%09friend
+Relation() %7B%0A%09%09Relation relation = new Relation();%0A%09%09relation
 .set
@@ -2212,30 +2212,32 @@
 l(email);%0A%09%09
-friend
+relation
 .setName(nam
@@ -2238,30 +2238,32 @@
 me(name);%0A%09%09
-friend
+relation
 .setSurname(
@@ -2270,30 +2270,32 @@
 surname);%0A%09%09
-friend
+relation
 .setPubKey(p
@@ -2300,30 +2300,32 @@
 (pubKey);%0A%09%09
-friend
+relation
 .setUnixTime
@@ -2338,22 +2338,24 @@
 ime);%0A%09%09
-friend
+relation
 .setApro
@@ -2374,14 +2374,16 @@
 ;%0A%09%09
-friend
+relation
 .get

Change Friend to Relation