package com.qmth.boot.tools.models;

/**
 * String为key，任意类型value的简单KV工具类
 *
 * @param <T>
 */
public class KV<T> {

    private String key;

    private T value;

    public KV() {
    }

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

    public static <T> KV of(String key, T value) {
        return new KV(key, value);
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public T getValue() {
        return value;
    }

    public void setValue(T value) {
        this.value = value;
    }

    public String toString(String joiner) {
        return key + joiner + value.toString();
    }
}
