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

net.sixpointsix.carpo.common.extractor.PropertyExtractor Maven / Gradle / Ivy

There is a newer version: 0.7.0
Show newest version
package net.sixpointsix.carpo.common.extractor;

import net.sixpointsix.carpo.common.model.PropertyCollection;
import net.sixpointsix.carpo.common.model.PropertyHoldingEntity;

import java.util.function.Function;

/**
 * Extract properties from a flat property entity
 */
public interface PropertyExtractor {

    /**
     * Get a datapoint from an entity
     * @param propertyHoldingEntity
     * @param value value to find
     * @return String value
     */
    String getDatapoint(PropertyHoldingEntity propertyHoldingEntity, String value);

    /**
     * Get a datapoint from an entity
     * @param propertyCollection
     * @param value to find
     * @return String value
     */
    String getDatapoint(PropertyCollection propertyCollection, String value);

    /**
     * Get a datapoint from an entity
     * @param propertyHoldingEntity
     * @param value to find
     * @param propertyType expected property type
     * @param extractor function to get the value
     * @return String value
     */
     String getDatapoint(PropertyHoldingEntity propertyHoldingEntity, String value, Class propertyType, Function extractor);

    /**
     * Get a datapoint from an entity
     * @param propertyCollection
     * @param value to find
     * @param propertyType expected property type
     * @param extractor function to get the value
     * @return String value
     */
     String getDatapoint(PropertyCollection propertyCollection, String value, Class propertyType, Function extractor);

    /**
     * Get a datapoint from an entity
     *
     * @param propertyHoldingEntity
     * @param value                 to find
     * @param propertyType          expected property type
     * @param extractor             function to get the value
     * @return Datapoint value
     */
     String getDatapoint(PropertyHoldingEntity propertyHoldingEntity, String value, Class propertyType, Function extractor, Integer index);

    /**
     * Get a datapoint from an entity
     *
     * @param propertyCollection
     * @param value              to find
     * @param propertyType       expected property type
     * @param extractor          function to get the value
     * @return Datapoint value
     */
     String getDatapoint(PropertyCollection propertyCollection, String value, Class propertyType, Function extractor, Integer index);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy