package org.scribe.model;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import org.scribe.exceptions.OAuthException;
import org.scribe.utils.OAuthEncoder;

/**
 * @author: Pablo Fernandez
 */
public class Parameter implements Comparable<Parameter>
{
  private static final String UTF = "UTF8";

  private final String key;
  private final String value;

  public Parameter(String key, String value)
  {
    this.key = key;
    this.value = value;
  }

  public String asUrlEncodedPair()
  {
    return OAuthEncoder.encode(key).concat("=").concat(OAuthEncoder.encode(value));
  }
  
  public boolean equals(Object other)
  {
    if(other == null) return false;
    if(other == this) return true;
    if(!(other instanceof Parameter)) return false;
    
    Parameter otherParam = (Parameter) other;
    return otherParam.key.equals(key) && otherParam.value.equals(value);
  }

  public int hashCode()
  {
    return key.hashCode() + value.hashCode();
  }

  public int compareTo(Parameter parameter)
  {
    int keyDiff = key.compareTo(parameter.key);

    return keyDiff != 0 ? keyDiff : value.compareTo(parameter.value);
  }
}

@@ -24,126 +24,8 @@
 l;%0A%0A
-import java.io.UnsupportedEncodingException;%0Aimport java.net.URLEncoder;%0Aimport org.scribe.exceptions.OAuthException;%0A
 impo
@@ -157,53 +157,8 @@
 %3E%0A%7B%0A
-  private static final String UTF = %22UTF8%22;%0A%0A
   pr

Remove unused imports and variables.