package link.at17.mid.tushare.data.models;

import lombok.Data;
import lombok.experimental.Accessors;

@Data
@Accessors(chain=true)
public class IndexValue<I extends Comparable<I>, T> implements Comparable<IndexValue<I, T>> {
    private T value;
    private I index;
    
    @Override
    public int compareTo(IndexValue<I, T> o) {
        return index.compareTo(o.index);
    }
    
    public IndexValue(I index, T value) {
        this.index = index;
        this.value = value;
    }
}
