org.springframework.batch.item.ExecutionContext.isDirty()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(83)

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

ExecutionContext.isDirty介绍

[英]Indicates if context has been changed with a "put" operation since the dirty flag was last cleared. Note that the last time the flag was cleared might correspond to creation of the context.
[中]指示自上次清除脏标志后,上下文是否已通过“put”操作更改。请注意,上次清除标志的时间可能对应于上下文的创建。

代码示例

代码示例来源:origin: spring-projects/spring-batch

@Test
public void testDirtyFlag() {
  assertFalse(context.isDirty());
  context.putString("1", "test");
  assertTrue(context.isDirty());
  context.clearDirtyFlag();
  assertFalse(context.isDirty());
}

代码示例来源:origin: spring-projects/spring-batch

@Test
public void testNotDirtyWithRemoveMissing() {
  context.putString("1", "test");
  assertTrue(context.isDirty());
  context.putString("1", null); // remove an item that was present
  assertTrue(context.isDirty());
  context.putString("1", null); // remove a non-existent item
  assertFalse(context.isDirty());
}

代码示例来源:origin: spring-projects/spring-batch

if (context.isDirty()) {

代码示例来源:origin: spring-projects/spring-batch

@Test
public void testNotDirtyWithDuplicate() {
  context.putString("1", "test");
  assertTrue(context.isDirty());
  context.clearDirtyFlag();
  context.putString("1", "test");
  assertFalse(context.isDirty());
}

代码示例来源:origin: com.marklogic/marklogic-spring-batch

public AdaptedExecutionContext(ExecutionContext exeContext) throws InstantiationException, IllegalAccessException {
  this.hashCode = exeContext.hashCode();
  this.dirtyFlag = exeContext.isDirty();
  
  // Get a set of the entries
  Set<Entry<String, Object>> set = exeContext.entrySet();
  // Get an iterator
  Iterator<Entry<String,Object>> i = set.iterator();
   // Display elements
  while(i.hasNext()) {
    Entry<String, Object> me = i.next();
    String name = me.getKey();
    Object obj = getValue(me.getValue());
    map.put(name, obj);
  }
}

代码示例来源:origin: org.springframework.batch/spring-batch-core

if (context.isDirty()) {

代码示例来源:origin: org.springframework.batch.core/org.motechproject.org.springframework.batch.core

if (context.isDirty()) {

代码示例来源:origin: org.springframework.batch/org.springframework.batch.core

if (context.isDirty()) {

代码示例来源:origin: apache/servicemix-bundles

if (context.isDirty()) {

相关文章