![JAR search and dependency download from the Maven repository](/logo.png)
org.organicdesign.fp.collections.KeyVal Maven / Gradle / Ivy
package org.organicdesign.fp.collections;
import java.util.Map;
import java.util.Objects;
import org.organicdesign.fp.tuple.Tuple2;
import static org.organicdesign.fp.FunctionUtils.stringify;
/**
Replaced with {@link org.organicdesign.fp.tuple.Tuple2} and the shortcut
{@link org.organicdesign.fp.StaticImports#tup(Object, Object)}.
*/
@Deprecated
public class KeyVal extends Tuple2 {
/** Public static Key/Value factory method */
public static KeyVal of(K a, V b) { return new KeyVal<>(a, b); }
/** Public static Map.Entry factory method */
public static KeyVal of(Map.Entry entry) { return new KeyVal<>(entry); }
/** Key/Value Constructor */
public KeyVal(K k, V v) { super(k, v); }
/** Map.Entry Constructor */
public KeyVal(Map.Entry entry) { super(entry.getKey(), entry.getValue()); }
@Override public String toString() {
return "kv(" + stringify(_1) + "," + stringify(_2) + ")";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy