package com.github.windsekirun.naraetextview;

import com.github.windsekirun.naraetextview.util.OnLinkClickListener;

import java.util.regex.Pattern;

/**
 * NaraeTextView
 * class: Clickable
 * Created by WindSekirun on 15. 8. 5..
 */
public class Clickable {

    protected String text;
    protected Pattern pattern;

    protected OnLinkClickListener linkClickListener;

    public Clickable(Clickable clickable) {
        text = clickable.text;
        pattern = clickable.pattern;
        linkClickListener = clickable.linkClickListener;
    }

    public Clickable(String text) {
        this.text = text;
        this.pattern = null;
    }

    public Clickable(Pattern pattern) {
        this.pattern = pattern;
        this.text = null;
    }

    public Pattern getPattern() {
        return pattern;
    }

    public String getText() {
        return text;
    }

    public void setPattern(Pattern pattern) {
        this.pattern = pattern;
    }

    public Clickable setText(String text) {
        this.text = text;
        return null;
    }

    public OnLinkClickListener getLinkClickListener() {
        return linkClickListener;
    }

    public void setLinkClickListener(OnLinkClickListener linkClickListener) {
        this.linkClickListener = linkClickListener;
    }
}

@@ -877,28 +877,33 @@
 %0A    public 
-void
+Clickable
  setPattern(
@@ -945,32 +945,53 @@
 tern = pattern;%0A
+        return this;%0A
     %7D%0A%0A    publi
@@ -1066,20 +1066,20 @@
  return 
-null
+this
 ;%0A    %7D%0A
@@ -1191,12 +1191,17 @@
 lic 
-void
+Clickable
  set
@@ -1307,20 +1307,41 @@
 ckListener;%0A
+        return this;%0A
     %7D%0A%7D%0A

return Clickable method