/*
 * @author Ranides Atterwim <ranides@gmail.com>
 * @copyright Ranides Atterwim
 * @license WTFPL
 * @url http://ranides.net/projects/assira.drafts
 */
package net.ranides.assira.collection.maps;

import net.ranides.assira.reflection.IClass;

/**
 *
 * @author Ranides Atterwim <ranides@gmail.com>
 */
public interface GenericEntry<K> {
    
    IClass<?> type();
    
    GenericKey<K,?> getKey();
    
    Object getValue();
    
    void setValue(Object value);

    class Simple<K> implements GenericEntry<K> {

        private final GenericKey<K, ?> key;
        private Object value;

        public Simple(GenericKey<K, ?> key, Object value) {
            this.key = key;
            this.value = value;
        }

        @Override
        public IClass<?> type() {
            return key.type();
        }

        @Override
        public GenericKey<K, ?> getKey() {
            return key;
        }

        @Override
        public Object getValue() {
            return value;
        }

        @Override
        public void setValue(Object value) {
            this.value = value;
        }
    }
    
}
