@@ -0,0 +1,3340 @@
+/*%0A * LensKit, an open source recommender systems toolkit.%0A * Copyright 2010-2014 LensKit Contributors.  See CONTRIBUTORS.md.%0A * Work on LensKit has been funded by the National Science Foundation under%0A * grants IIS 05-34939, 08-08692, 08-12148, and 10-17697.%0A *%0A * This program is free software; you can redistribute it and/or modify%0A * it under the terms of the GNU Lesser General Public License as%0A * published by the Free Software Foundation; either version 2.1 of the%0A * License, or (at your option) any later version.%0A *%0A * This program is distributed in the hope that it will be useful, but WITHOUT%0A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS%0A * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more%0A * details.%0A *%0A * You should have received a copy of the GNU General Public License along with%0A * this program; if not, write to the Free Software Foundation, Inc., 51%0A * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.%0A */%0Apackage org.lenskit.data.entities;%0A%0Aimport com.google.common.base.Preconditions;%0Aimport org.apache.commons.lang3.builder.EqualsBuilder;%0Aimport org.apache.commons.lang3.builder.HashCodeBuilder;%0Aimport org.apache.commons.lang3.builder.ToStringBuilder;%0A%0Aimport javax.annotation.Nonnull;%0A%0A/**%0A * An attribute-value association.%0A * @param %3CT%3E The attribute type.%0A */%0Apublic final class AttributeValue%3CT%3E %7B%0A    private final Attribute%3CT%3E attribute;%0A    private final T value;%0A%0A    /**%0A     * Create a new attribute-value pair.%0A     * @param attr The attribute.%0A     * @param val The value.%0A     */%0A    public AttributeValue(@Nonnull Attribute%3CT%3E attr, @Nonnull T val) %7B%0A        Preconditions.checkNotNull(attr, %22attribute%22);%0A        Preconditions.checkNotNull(val, %22value%22);%0A        attribute = attr;%0A        value = val;%0A    %7D%0A%0A    /**%0A     * Create a new attribute-value pair.%0A     * @param attr The attribute.%0A     * @param val The value.%0A     * @param %3CT%3E The attribute type.%0A     * @return The attribute-value object.%0A     */%0A    public static %3CT%3E AttributeValue%3CT%3E create(@Nonnull Attribute%3CT%3E attr,%0A                                               @Nonnull T val) %7B%0A        return new AttributeValue%3C%3E(attr, val);%0A    %7D%0A%0A    /**%0A     * Get the attribute.%0A     * @return The attribute associated with this value.%0A     */%0A    @Nonnull%0A    public Attribute%3CT%3E getAttribute() %7B%0A        return attribute;%0A    %7D%0A%0A    /**%0A     * Get the value.%0A     * @return The value associated with the attribute.%0A     */%0A    @Nonnull%0A    public T getValue() %7B%0A        return value;%0A    %7D%0A%0A    @Override%0A    public boolean equals(Object o) %7B%0A        if (this == o) return true;%0A%0A        if (o == null %7C%7C getClass() != o.getClass()) return false;%0A%0A        AttributeValue%3C?%3E that = (AttributeValue%3C?%3E) o;%0A%0A        return new EqualsBuilder()%0A                .append(attribute, that.attribute)%0A                .append(value, that.value)%0A                .isEquals();%0A    %7D%0A%0A    @Override%0A    public int hashCode() %7B%0A        return new HashCodeBuilder(17, 37)%0A                .append(attribute)%0A                .append(value)%0A                .toHashCode();%0A    %7D%0A%0A    @Override%0A    public String toString() %7B%0A        return new ToStringBuilder(this)%0A                .append(%22attribute%22, attribute)%0A                .append(%22value%22, value)%0A                .toString();%0A    %7D%0A%7D%0A

Add AttributeValue class