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

org.unipop.schema.property.ParentSchemaProperty Maven / Gradle / Ivy

There is a newer version: 0.2.1
Show newest version
package org.unipop.schema.property;

import java.util.Collection;
import java.util.Collections;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;

/**
 * Created by sbarzilay on 8/2/16.
 */
public interface ParentSchemaProperty extends PropertySchema{
    Collection getChildren();

    default Set excludeDynamicFields() {
        return getChildren().stream()
                .map(PropertySchema::excludeDynamicFields)
                .flatMap(Collection::stream).collect(Collectors.toSet());
    }

    default Set toFields(Set propertyKeys) {
        return getChildren().stream().flatMap(s -> s.toFields(propertyKeys).stream()).collect(Collectors.toSet());
    }

    default Map toFields(Map properties){
        return Collections.emptyMap();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy