本文整理汇总了Java中org.javers.core.diff.changetype.NewObject类的典型用法代码示例。如果您正苦于以下问题:Java NewObject类的具体用法?Java NewObject怎么用?Java NewObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NewObject类属于org.javers.core.diff.changetype包,在下文中一共展示了NewObject类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fromJson
import org.javers.core.diff.changetype.NewObject; //导入依赖的package包/类
@Override
public NewObject fromJson(JsonElement json, JsonDeserializationContext context) {
JsonObject jsonObject = (JsonObject) json;
CommitMetadata commitMetadata = deserializeCommitMetadata(jsonObject, context);
return new NewObject(deserializeAffectedCdoId(jsonObject,context), Optional.empty(), ofNullable(commitMetadata));
}
示例2: addInitialChanges
import org.javers.core.diff.changetype.NewObject; //导入依赖的package包/类
private void addInitialChanges(List<Change> changes, CdoSnapshot initialSnapshot) {
CdoSnapshot emptySnapshot = CdoSnapshotBuilder.emptyCopyOf(initialSnapshot).build();
Diff diff = diffFactory.create(snapshotGraph(emptySnapshot), snapshotGraph(initialSnapshot),
commitMetadata(initialSnapshot));
NewObject newObjectChange =
new NewObject(initialSnapshot.getGlobalId(), empty(), of(initialSnapshot.getCommitMetadata()));
changes.addAll(diff.getChanges());
changes.add(newObjectChange);
}
示例3: getValueType
import org.javers.core.diff.changetype.NewObject; //导入依赖的package包/类
@Override
public Class getValueType() {
return NewObject.class;
}
示例4: getChangeSet
import org.javers.core.diff.changetype.NewObject; //导入依赖的package包/类
@Override
public Set<Change> getChangeSet(GraphPair graphPair) {
return Sets.transform(graphPair.getOnlyOnRight(), input ->
new NewObject(input.getGlobalId(), input.wrappedCdo()));
}
示例5: onNewObject
import org.javers.core.diff.changetype.NewObject; //导入依赖的package包/类
@Override
public void onNewObject(NewObject newObject) {
appendln(" new object: " + newObject.getAffectedGlobalId());
}