package logback;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ParameterizedTypeTestClass<K, E> implements
        ParameterizedTypeTestInterface<K, E> {
    private static Logger LOG =
            LoggerFactory.getLogger(ParameterizedTypeTestClass.class);

    public ParameterizedTypeTestClass() {
        ParameterizedType genericSuperClass =
                (ParameterizedType) getClass().getGenericSuperclass();
        LOG.debug("genericSuperClass={}", genericSuperClass);

        Type[] types = genericSuperClass.getActualTypeArguments();
        LOG.debug("ActualTypeArguments={}", types);
        // only displays the first element:
        // ActualTypeArguments=class java.lang.Long

        LOG.debug("ActualTypeArguments array count={}", types.length);
        for (Type type : types) {
            LOG.debug("type={}", type);
        }
    }
}