本文整理了Java中org.apache.isis.core.commons.ensure.Assert
类的一些代码示例,展示了Assert
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Assert
类的具体详情如下:
包路径:org.apache.isis.core.commons.ensure.Assert
类名称:Assert
暂无
代码示例来源:origin: org.apache.isis.runtimes.dflt.objectstores/xml
public ServiceElement(final SerialOid oid, final String id) {
Assert.assertNotNull("oid", oid);
Assert.assertNotNull("id", id);
this.oid = oid;
this.id = id;
}
}
代码示例来源:origin: org.apache.isis.runtimes.dflt.objectstores/sql-impl
@Override
public void copyFrom(final Oid oid) {
Assert.assertTrue(oid instanceof SqlOid);
final SqlOid from = (SqlOid) oid;
this.primaryKey = from.primaryKey;
this.className = from.className;
}
代码示例来源:origin: org.apache.isis.core/commons
public static void assertFalse(final boolean flag) {
assertFalse("expected false", flag);
}
代码示例来源:origin: org.apache.isis.runtimes.dflt.objectstores/sql-impl
@Override
public void makePersistent() {
Assert.assertTrue(state.isTransient());
Assert.assertNotNull(newPrimaryKey);
previous = new SqlOid(this.className, this.primaryKey, state);
this.primaryKey = newPrimaryKey;
this.state = State.PERSISTENT;
}
代码示例来源:origin: org.apache.isis.core/isis-core-runtime
Assert.assertNotNull(adapter);
final Object pojo = adapter.getObject();
Assert.assertFalse("POJO Map already contains object", pojo, pojoAdapterMap.containsPojo(pojo));
代码示例来源:origin: org.apache.isis.runtimes.dflt/runtime
@Override
public void resolveImmediately(final ObjectAdapter adapter) {
// synchronize on the current session because getting race
// conditions, I think between different UI threads when running
// with DnD viewer + in-memory object store +
// cglib bytecode enhancement
synchronized (getAuthenticationSession()) {
final ResolveState resolveState = adapter.getResolveState();
if (!resolveState.canChangeTo(ResolveState.RESOLVING)) {
return;
}
Assert.assertFalse("only resolve object that is not yet resolved", adapter, resolveState.isResolved());
Assert.assertTrue("only resolve object that is persistent", adapter, adapter.isPersistent());
resolveImmediatelyFromPersistenceLayer(adapter);
if (LOG.isDebugEnabled()) {
// don't log object - its toString() may use the unresolved
// field, or unresolved collection
LOG.debug("resolved: " + adapter.getSpecification().getShortIdentifier() + " " + resolveState.code() + " " + adapter.getOid());
}
}
}
代码示例来源:origin: org.apache.isis.core/commons
public static void assertEquals(final Object expected, final Object actual) {
assertEquals("", expected, actual);
}
代码示例来源:origin: org.apache.isis.core/commons
public static void assertSame(final Object expected, final Object actual) {
assertSame("", expected, actual);
}
代码示例来源:origin: org.apache.isis.runtimes.dflt/runtime
private ObjectAdapter mapAndInjectServices(final ObjectAdapter adapter) {
Assert.assertNotNull(adapter);
final Object pojo = adapter.getObject();
Assert.assertFalse("POJO Map already contains object", pojo, getPojoAdapterMap().containsPojo(pojo));
代码示例来源:origin: org.apache.isis.runtimes.dflt/runtime
public void init(final ObjectAdapter[] initElements) {
Assert.assertEquals("Collection not empty", 0, this.collection.size());
for (final ObjectAdapter initElement : initElements) {
collection.addElement(initElement);
}
}
代码示例来源:origin: org.apache.isis.runtimes.dflt/runtime
public AggregateAdapters(final ObjectAdapter rootAdapter) {
Assert.assertNotNull(rootAdapter);
this.rootAdapter = rootAdapter;
}
代码示例来源:origin: org.apache.isis.core/commons
public static void assertFalse(final String message, final Object target, final boolean flag) {
assertTrue(message, target, !flag);
}
代码示例来源:origin: org.apache.isis.runtimes.dflt.objectstores/xml
private void writeAssociationField(final StringBuffer xml, final String field, final Object entry) {
Assert.assertFalse(((SerialOid) entry).isTransient());
xml.append(" <association field=\"" + field + "\" ");
xml.append("ref=\"" + encodedOid((SerialOid) entry) + "\"/>\n");
}
代码示例来源:origin: org.apache.isis.runtimes.dflt/runtime
public ObjectAdapter createTransientTestObject(final Object domainObject) {
final TestProxyOid oid = new TestProxyOid(nextId++, false);
final ObjectAdapter adapterFor = getAdapterManagerTestSupport().testCreateTransient(domainObject, oid);
Assert.assertEquals("", ResolveState.TRANSIENT, adapterFor.getResolveState());
return adapterFor;
}
代码示例来源:origin: org.apache.isis.core/commons
public static void assertNotNull(final Object object) {
assertNotNull("", object);
}
代码示例来源:origin: org.apache.isis.core/commons
public static void assertTrue(final boolean flag) {
assertTrue("expected true", flag);
}
代码示例来源:origin: org.apache.isis.runtimes.dflt/runtime
public void addCollectionAdapter(final OneToManyAssociation otma, final ObjectAdapter collectionAdapter) {
Assert.assertNotNull(otma);
Assert.assertNotNull(collectionAdapter);
collectionAdapters.put(otma, collectionAdapter);
}
代码示例来源:origin: org.apache.isis.core/commons
public static void assertNull(final Object object) {
assertTrue("unexpected reference; should be null", object == null);
}
代码示例来源:origin: org.apache.isis.core/isis-core-runtime
private void addCollectionAdapter(final OneToManyAssociation otma, final ObjectAdapter collectionAdapter) {
Assert.assertNotNull(otma);
Assert.assertNotNull(collectionAdapter);
collectionAdapters.put(otma, collectionAdapter);
}
代码示例来源:origin: org.apache.isis.core/commons
public static void assertNull(final String message, final Object object) {
assertTrue(message, object == null);
}
内容来源于网络,如有侵权,请联系作者删除!