org.javers.core.diff.appenders.NewObjectAppender 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.diff.appenders;
import org.javers.core.diff.Change;
import org.javers.core.diff.GraphPair;
import org.javers.core.diff.changetype.NewObject;
import java.util.Set;
import java.util.stream.Collectors;
class NewObjectAppender implements NodeChangeAppender {
@Override
public Set getChangeSet(GraphPair graphPair) {
return (Set)graphPair.getOnlyOnRight().stream()
.map(input -> new NewObject(input.getGlobalId(), input.wrappedCdo(), graphPair.getCommitMetadata()))
.collect(Collectors.toSet());
}
}