All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.wizzardo.tools.reflection.FieldInfo Maven / Gradle / Ivy

There is a newer version: 0.23
Show newest version
package com.wizzardo.tools.reflection;

import java.lang.reflect.Field;
import java.util.Collections;
import java.util.Map;

/**
 * @author: wizzardo
 * Date: 3/22/14
 */
public class FieldInfo {
    public final Field field;
    public final G generic;
    public final T reflection;

    public FieldInfo(Field field, T reflection, G generic) {
        this.field = field;
        this.reflection = reflection;
        this.generic = generic;
    }

    public FieldInfo(Field field, T reflection) {
        this.field = field;
        this.reflection = reflection;
        this.generic = createGeneric(field, Collections.emptyMap());
    }

    public FieldInfo(Field field, T reflection, Map types) {
        this.field = field;
        this.reflection = reflection;
        this.generic = createGeneric(field, types);
    }

    protected G createGeneric(Field field, Map types) {
        return (G) new Generic(field.getGenericType(), types);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy