package org.aming.web.qq.domain;

import org.apache.commons.lang3.builder.ToStringBuilder;

import java.io.Serializable;

/**
 * @author daming
 * @version 2017/10/5.
 */
public class Relationship implements Serializable {
    private int id;
    private String userId1;
    private String userId2;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getUserId1() {
        return userId1;
    }

    public void setUserId1(String userId1) {
        this.userId1 = userId1;
    }

    public String getUserId2() {
        return userId2;
    }

    public void setUserId2(String userId2) {
        this.userId2 = userId2;
    }

    public Relationship(){
        super();
    }

    public Relationship(String userId1,String userId2){
        super();
        this.userId1 = userId1;
        this.userId2 = userId2;
    }

    public Relationship(int id,String userId1,String userId2){
        super();
        this.id = id;
        this.userId1 = userId1;
        this.userId2 = userId2;
    }

    @Override
    public String toString(){
        return ToStringBuilder.reflectionToString(this);
    }

    public Relationship reverse(){
        return new Relationship(this.userId2,this.userId1);
    }


}

@@ -351,28 +351,36 @@
 %0A    public 
-void
+Relationship
  setId(int i
@@ -402,24 +402,45 @@
 is.id = id;%0A
+        return this;%0A
     %7D%0A%0A    p
@@ -501,36 +501,44 @@
   %7D%0A%0A    public 
-void
+Relationship
  setUserId1(Stri
@@ -575,32 +575,53 @@
 rId1 = userId1;%0A
+        return this;%0A
     %7D%0A%0A    publi
@@ -690,12 +690,20 @@
 lic 
-void
+Relationship
  set
@@ -752,32 +752,53 @@
 rId2 = userId2;%0A
+        return this;%0A
     %7D%0A%0A    publi

use fluent api design