com.dooapp.gaedo.finders.collections.CollectionValueFetcher Maven / Gradle / Ivy
package com.dooapp.gaedo.finders.collections;
import com.dooapp.gaedo.finders.FieldInformer;
import com.dooapp.gaedo.finders.projection.ValueFetcher;
import com.dooapp.gaedo.properties.Property;
public class CollectionValueFetcher implements ValueFetcher {
private DataType sourceData;
public CollectionValueFetcher(DataType element) {
this.sourceData = element;
}
@Override
public Type getValue(FieldInformer propertyDescriptor) {
Iterable path = propertyDescriptor.getFieldPath();
Object valueCache = sourceData;
for(Property p : path) {
valueCache = p.get(valueCache);
}
return (Type) valueCache;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy