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

org.javers.core.metamodel.scanner.PropertyScan Maven / Gradle / Ivy

package org.javers.core.metamodel.scanner;

import org.javers.common.validation.Validate;
import org.javers.core.metamodel.property.Property;

import java.util.Collections;
import java.util.List;

/**
 * @author bartosz.walacik
 */
class PropertyScan {
    private final List properties;
    private final boolean hasId;

    PropertyScan(List properties) {
        Validate.argumentIsNotNull(properties);
        this.properties = properties;
        hasId = properties.stream().anyMatch(p -> p.looksLikeId());
    }

    Property getFirst(){
        return properties.get(0);
    }

    List getProperties() {
        return Collections.unmodifiableList(properties);
    }

    boolean hasId(){
        return hasId;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy