package org.canthack.tris.oyver;

import java.io.Serializable;

class Vote implements Serializable{
	private static final long serialVersionUID = -5022092856758509133L;

	static final int YAY = 0;
	static final int MEH = 1;
	static final int NAY = 2;

	private String url = "";

	private String talkName;

	private int voteType;

	Vote(String endpoint, int id, String name, int vt){
		this.talkName = name;
		this.voteType = vt;
		
		StringBuilder urlBuilder = new StringBuilder().append(endpoint);
		if(!endpoint.endsWith("/")) urlBuilder.append('/');

		urlBuilder.append("INCR").append('/').append(id).append('_');

		switch(vt){
		case YAY: 
			urlBuilder.append("yay");
			break;
		case MEH: 
			urlBuilder.append("meh");
			break;
		case NAY: 
			urlBuilder.append("nay");
			break;
		}
		
		url = urlBuilder.toString();
	}

	String getUrl(){
		return url;
	}
	
	public String toString(){
		StringBuilder builder = new StringBuilder().append(talkName).append(" ");
		switch(this.voteType){
		case YAY: 
			builder.append(":)");
			break;
		case MEH: 
			builder.append(":|");
			break;
		case NAY: 
			builder.append(":(");
			break;
		}
		
		builder.append("\n").append(url);
		return builder.toString();
	}
}

@@ -858,16 +858,119 @@
  url;%0A%09%7D
+%0A%0A    String getTalkName() %7B%0A        return talkName;%0A    %7D%0A%0A%09int getVoteType() %7B%0A%09%09return voteType;%0A%09%7D
 %0A%09%0A%09publ

Add accessors to Vote class.