package org.handwerkszeug.riak.http;

public class LinkCondition {

	public static final String ANY = "_";

	final String bucket;

	final String tag;

	final boolean keep;

	public LinkCondition(String bucket, String tag, boolean keep) {
		if (bucket == null) {
			this.bucket = ANY;
		} else {
			this.bucket = bucket;
		}
		if (tag == null) {
			this.tag = ANY;
		} else {
			this.tag = tag;
		}
		this.keep = keep;
	}

	public static LinkCondition bucket(String bucket) {
		return bucket(bucket, false);
	}

	public static LinkCondition bucket(String bucket, boolean keep) {
		return new LinkCondition(bucket, ANY, keep);
	}

	public static LinkCondition tag(String tag) {
		return tag(tag, false);
	}

	public static LinkCondition tag(String tag, boolean keep) {
		return new LinkCondition(ANY, tag, keep);
	}

	public String getBucket() {
		return this.bucket;
	}

	public String getTag() {
		return this.tag;
	}

	public int getKeep() {
		return this.keep ? 1 : 0;
	}
}

@@ -974,11 +974,15 @@
 lic 
-int
+boolean
  get
@@ -1013,16 +1013,8 @@
 keep
- ? 1 : 0
 ;%0D%0A%09

int to boolean