package com.librato.metrics.client;

public class Tag {
    public final String name;
    public final String value;

    public Tag(String name, String value) {
        this.name = name;
        this.value = value;
    }

    @Override
    public String toString() {
        return name + "=" + value;
    }
}

package com.librato.metrics.client;

import org.codehaus.jackson.annotate.JsonCreator;
import org.codehaus.jackson.annotate.JsonProperty;

public class Tag {
    @JsonProperty("name")
    public final String name;
    @JsonProperty("value")
    public final String value;

    @JsonCreator
    public Tag(@JsonProperty("name") String name,
               @JsonProperty("value") String value) {
        this.name = name;
        this.value = value;
    }

    @Override
    public String toString() {
        return name + "=" + value;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Tag tag = (Tag) o;

        if (name != null ? !name.equals(tag.name) : tag.name != null)
            return false;
        return value != null ? value.equals(tag.value) : tag.value == null;
    }

    @Override
    public int hashCode() {
        int result = name != null ? name.hashCode() : 0;
        result = 31 * result + (value != null ? value.hashCode() : 0);
        return result;
    }
}

Add JSON annotations and equals/hashcode to Tag