package io.airlift.jaxrs;

import com.google.common.base.Function;
import com.google.inject.Key;

import java.util.Objects;

import static com.google.common.base.Objects.toStringHelper;
import static com.google.common.base.Preconditions.checkNotNull;

final class JaxrsBinding
{
    private final Key<?> key;

    JaxrsBinding(Key<?> key)
    {
        this.key = checkNotNull(key, "key is null");
    }

    public Key<?> getKey()
    {
        return key;
    }

    @Override
    public int hashCode()
    {
        return Objects.hash(key);
    }

    @Override
    public boolean equals(Object obj)
    {
        if (this == obj) {
            return true;
        }
        if (obj == null || getClass() != obj.getClass()) {
            return false;
        }
        JaxrsBinding other = (JaxrsBinding) obj;
        return Objects.equals(this.key, other.key);
    }

    @Override
    public String toString()
    {
        return toStringHelper(this)
                .add("key", key)
                .toString();
    }

    public static Function<JaxrsBinding, Key<?>> keyGetter()
    {
        return new Function<JaxrsBinding, Key<?>>()
        {
            @Override
            public Key<?> apply(JaxrsBinding binding)
            {
                return binding.getKey();
            }
        };
    }
}

@@ -24,48 +24,8 @@
 s;%0A%0A
-import com.google.common.base.Function;%0A
 impo
@@ -50,16 +50,16 @@
 ct.Key;%0A
+
 %0Aimport 
@@ -362,68 +362,8 @@
  %7D%0A%0A
-    public Key%3C?%3E getKey()%0A    %7B%0A        return key;%0A    %7D%0A%0A
     
@@ -882,24 +882,24 @@
 %22key%22, key)%0A
+
             
@@ -924,299 +924,7 @@
    %7D
-%0A%0A    public static Function%3CJaxrsBinding, Key%3C?%3E%3E keyGetter()%0A    %7B%0A        return new Function%3CJaxrsBinding, Key%3C?%3E%3E()%0A        %7B%0A            @Override%0A            public Key%3C?%3E apply(JaxrsBinding binding)%0A            %7B%0A                return binding.getKey();%0A            %7D%0A        %7D;%0A    %7D
 %0A%7D%0A

Remove unused method in JaxrsBinding