org.babyfish.lang.Arguments.mustBeNull()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(112)

本文整理了Java中org.babyfish.lang.Arguments.mustBeNull()方法的一些代码示例,展示了Arguments.mustBeNull()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Arguments.mustBeNull()方法的具体详情如下:
包路径:org.babyfish.lang.Arguments
类名称:Arguments
方法名:mustBeNull

Arguments.mustBeNull介绍

暂无

代码示例

代码示例来源:origin: babyfish-ct/babyfish

protected ModificationEvent(Object source, ModificationEvent target) {
  super(source);
  Arguments.mustBeNull("target.getCause()", target.getCause());
  this.modificationType = target.modificationType;
  this.eventType = EventType.DISPATCHED;
  this.modification = target.modification;
  
  IdentityHashMap<Object, ModificationEvent> map = target.dispatchedEventMap;
  if (map == null) {
    map = new IdentityHashMap<>();
    target.dispatchedEventMap = map;
  }
  map.put(source, this);
  
  this.localAttributeContext = EventAttributeContext.of(AttributeScope.LOCAL);
  this.bubbleChainAttributeContext = EventAttributeContext.of(AttributeScope.IN_BUBBLE_CHAIN);
  this.dispatchChainAttributeContext = target.getAttributeContext(AttributeScope.IN_DISPATCH_CHAIN);
  this.allChianAttributeContext = target.getAttributeContext(AttributeScope.IN_ALL_CHAIN);
  this.globalAttributeContext = target.getAttributeContext(AttributeScope.GLOBAL);
}

代码示例来源:origin: babyfish-ct/babyfish

public long createBook(Book book) {
  Arguments.mustBeNull(
      "book.id", 
      Arguments.mustNotBeNull("book", book).getId()
  );
  try (TransactionScope ts = new TransactionScope(this.connectionString)) {
    return ts.complete(this.bookRepository.mergeBook(book).getId());
  }
}

代码示例来源:origin: babyfish-ct/babyfish

public long createAuthor(Author author) {
    Arguments.mustBeNull(
        "author.id", 
        Arguments.mustNotBeNull("author", author).getId()
    );
    try (TransactionScope ts = new TransactionScope(this.connectionString)) {
      // In real project, please don't do this
      // You should create AuthorRepository and
      // NEVER invoke any JPA API here directly.
      return ts.complete(TransactionScope.getEntityManager().merge(author).getId());
    }
  }
}

相关文章