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

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

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

import static java.lang.Integer.parseInt;

class CollectionDataPropertyReader extends DataPropertyAccessor implements PropertyReader {
    CollectionDataPropertyReader(BeanClass beanClass, String name, BeanClass type) {
        super(beanClass, name, type);
    }

    @Override
    public Object getValue(T instance) {
        return CollectionHelper.toStream(instance).toArray()[parseInt(getName())];
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy