本文整理了Java中org.apache.isis.core.metamodel.adapter.oid.Oid.copyFrom()
方法的一些代码示例,展示了Oid.copyFrom()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Oid.copyFrom()
方法的具体详情如下:
包路径:org.apache.isis.core.metamodel.adapter.oid.Oid
类名称:Oid
方法名:copyFrom
[英]Copies the content of the specified oid into this oid.
After this call the #hashCode() return by both the specified object and this object will be the same, and both objects will be #equals(Object).
[中]将指定oid的内容复制到此oid中。
在这个调用之后,指定对象和这个对象返回的#hashCode()将是相同的,并且两个对象都是#equals(object)。
代码示例来源:origin: org.apache.isis.runtimes.dflt/runtime
@Override
public void remapUpdated(final Oid oid) {
ensureThatArg(oid.hasPrevious(), is(true));
final Oid previousOid = oid.getPrevious();
if (LOG.isDebugEnabled()) {
LOG.debug("remapping oid: " + oid + " with previous oid of: " + previousOid);
}
final ObjectAdapter lookedUpAdapter = oidAdapterMap.getAdapter(previousOid);
if (lookedUpAdapter == null) {
LOG.warn("could not locate previousOid: " + previousOid);
return;
}
if (LOG.isDebugEnabled()) {
LOG.debug("removing previous oid" + previousOid);
}
oidAdapterMap.remove(previousOid);
// we can't replace the Oid on the looked-up adapter, so instead we
// just make it the same value as the Oid we were originally passed in
final Oid lookedUpAdapterOid = lookedUpAdapter.getOid();
lookedUpAdapterOid.copyFrom(oid);
// finally re-map the adapter
oidAdapterMap.add(lookedUpAdapterOid, lookedUpAdapter);
}
代码示例来源:origin: org.apache.isis.runtimes.dflt/runtime
@Override
public void remapUpdated(final Oid oid) {
identities.remove(oid);
final Oid previousOid = oid.getPrevious();
final ObjectAdapter object = identities.get(previousOid);
if (object == null) {
return;
}
identities.remove(previousOid);
final Oid oidFromObject = object.getOid();
oidFromObject.copyFrom(oid);
identities.put(oidFromObject, object);
}
内容来源于网络,如有侵权,请联系作者删除!