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

com.github.leeonky.util.FieldPropertyReader Maven / Gradle / Ivy

The newest version!
package com.github.leeonky.util;

import java.lang.reflect.Field;
import java.lang.reflect.Modifier;

import static com.github.leeonky.util.Suppressor.get;

class FieldPropertyReader extends FieldPropertyAccessor implements PropertyReader {

    FieldPropertyReader(BeanClass beanClass, Field field) {
        super(beanClass, field);
    }

    @Override
    public Object getValue(T instance) {
        return get(() -> field.get(instance));
    }

    @Override
    public boolean isBeanProperty() {
        return !Modifier.isStatic(field.getModifiers());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy