org.javers.core.metamodel.scanner.PropertyScan Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of javers-core Show documentation
Show all versions of javers-core Show documentation
JaVers - object auditing and diff framework for Java
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;
}
}