package me.chyxion.tigon.model;

import java.util.Map;

/**
 * @version 0.0.1
 * @since 0.0.1
 * @author Shaun Chyxion <br>
 * chyxion@163.com <br>
 * Nov 8, 2016 11:00:45 AM
 */
public interface ViewModelable<T> extends Mappable {

    /**
     * @return data main data
     */
    T getData();

    /**
     * @param data data to set
     */
    ViewModelable<T> setData(T data);

    /**
     * @param name attr name
     * @param value attr value
     * @return this
     */
    ViewModelable<T> setAttr(String name, Object value);

    /**
     * @param name attr name
     * @param <V> attr value type
     * @return attr attr
     */
    <V> V getAttr(String name);

    /**
     * @return attrs
     */
    Map<String, Object> getAttrs();

    /**
     * @param attrs attrs
     * @return this this
     */
    ViewModelable<T> setAttrs(Map<String, Object> attrs);
}
