org.apache.isis.core.commons.ensure.Assert类的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(5.3k)|赞(0)|评价(0)|浏览(217)

本文整理了Java中org.apache.isis.core.commons.ensure.Assert类的一些代码示例,展示了Assert类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Assert类的具体详情如下:
包路径:org.apache.isis.core.commons.ensure.Assert
类名称: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);
}

相关文章