本文整理了Java中org.apache.isis.core.commons.ensure.Assert.assertTrue()
方法的一些代码示例,展示了Assert.assertTrue()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Assert.assertTrue()
方法的具体详情如下:
包路径:org.apache.isis.core.commons.ensure.Assert
类名称:Assert
方法名:assertTrue
暂无
代码示例来源: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 String message, final Object target, final boolean flag) {
assertTrue(message, target, !flag);
}
代码示例来源:origin: org.apache.isis.core/commons
public static void assertTrue(final boolean flag) {
assertTrue("expected true", flag);
}
代码示例来源: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/commons
public static void assertFalse(final String message, final boolean flag) {
assertTrue(message, !flag);
}
代码示例来源:origin: org.apache.isis.core/commons
public static void assertNotNull(final String message, final Object target, final Object object) {
assertTrue(message, target, object != null);
}
代码示例来源:origin: org.apache.isis.core/commons
public static void assertNull(final String message, final Object object) {
assertTrue(message, object == null);
}
代码示例来源:origin: org.apache.isis.core/commons
public static void assertSame(final String message, final Object expected, final Object actual) {
assertTrue(message + ": expected " + expected + " but was " + actual, expected == actual);
}
代码示例来源:origin: org.apache.isis.core/commons
public static void assertNotNull(final String message, final Object object) {
assertTrue("unexpected null: " + message, object != null);
}
代码示例来源:origin: org.apache.isis.core/commons
public static void assertTrue(final String message, final boolean flag) {
assertTrue(message, null, flag);
}
代码示例来源:origin: org.apache.isis.core/commons
public static void assertEquals(final String message, final Object expected, final Object actual) {
assertTrue(message + ": expected " + expected + " but was " + actual, (expected == null && actual == null) || (expected != null && expected.equals(actual)));
}
代码示例来源:origin: org.apache.isis.runtimes.dflt/runtime
@Override
public void copyFrom(final Oid oid) {
Assert.assertTrue(oid instanceof SerialOid);
final SerialOid from = (SerialOid) oid;
this.serialNo = from.serialNo;
this.state = from.state;
cacheState();
}
代码示例来源:origin: org.apache.isis.runtimes.dflt.objectstores/sql-impl
/**
* Should be called prior to {@link #makePersistent()}
*/
public void setId(final PrimaryKey primaryKey) {
Assert.assertTrue(state.isTransient());
this.newPrimaryKey = primaryKey;
}
代码示例来源:origin: org.apache.isis.runtimes.dflt/runtime
/**
* Should be called prior to {@link #makePersistent()}
*/
public void setId(final long serialNo) {
Assert.assertTrue(state.isTransient());
this.newSerialNo = serialNo;
}
代码示例来源:origin: org.apache.isis.core/metamodel
@Override
public <T> List<T> allMatches(final Class<T> type, final T pattern) {
Assert.assertTrue("pattern not compatible with type", type.isAssignableFrom(pattern.getClass()));
return allMatches(new QueryFindByPattern<T>(type, pattern));
}
代码示例来源:origin: org.apache.isis.runtimes.dflt/runtime
@Override
public void makePersistent() {
Assert.assertTrue(state.isTransient());
Assert.assertTrue(newSerialNo != 0);
previous = new SerialOid(this.serialNo, state);
this.serialNo = newSerialNo;
this.state = State.PERSISTENT;
cacheState();
}
代码示例来源:origin: org.apache.isis.viewer/scimpi-dispatcher
public TransientObjectMapping(final ObjectAdapter adapter) {
oid = adapter.getOid();
Assert.assertTrue("OID is for persistent", oid.isTransient());
Assert.assertTrue("adapter is for persistent", adapter.isTransient());
memento = new Memento(adapter);
}
代码示例来源:origin: org.apache.isis.runtimes.dflt.remoting/common
/**
* Called client-side only:
* <ul>
* <li>by {@link ClientSideTransactionManager#endTransaction()}
* </ul>
*/
@Override
public ObjectData encodeMakePersistentGraph(final ObjectAdapter adapter, final KnownObjectsRequest knownObjects) {
Assert.assertTrue("transient", adapter.isTransient());
return (ObjectData) encode(adapter, clientSideAddGraphDepth, knownObjects);
}
代码示例来源: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
private ObjectAdapter recreateReference(final Data data) {
// handle values
if (data instanceof StandaloneData) {
final StandaloneData standaloneData = (StandaloneData) data;
return standaloneData.getAdapter();
}
// reference to entity
Oid oid = data.getOid();
Assert.assertTrue("can only create a reference to an entity", oid instanceof RootOid);
final RootOid rootOid = (RootOid) oid;
final ObjectAdapter referencedAdapter = getPersistenceSession().adapterFor(rootOid);
if (data instanceof ObjectData) {
if (rootOid.isTransient()) {
updateObject(referencedAdapter, data);
}
}
return referencedAdapter;
}
内容来源于网络,如有侵权,请联系作者删除!