Package de.danielbechler.diff.access

Examples of de.danielbechler.diff.access.CollectionItemAccessor


                final Instances collectionInstances,
                final Iterable<?> items)
  {
    for (final Object item : items)
    {
      final Accessor itemAccessor = new CollectionItemAccessor(item);
      differDispatcher.dispatch(collectionNode, collectionInstances, itemAccessor);
    }
  }
View Full Code Here


  @Test
  public void hasChanges_returns_true_when_child_has_changed()
  {
    final DiffNode root = new DiffNode(List.class);
    final DiffNode child = new DiffNode(root, new CollectionItemAccessor("foo"), String.class);
    root.addChild(child);
    child.setState(DiffNode.State.ADDED);
    MatcherAssert.assertThat(root.hasChanges(), Is.is(true));
  }
View Full Code Here

  @Test
  public void addChild_establishes_parent_child_relationship() throws Exception
  {
    final DiffNode node1 = new DiffNode(List.class);
    final DiffNode node2 = new DiffNode(new CollectionItemAccessor("foo"), String.class);
    node1.addChild(node2);
    assertThat(node1.childCount()).isEqualTo(1);
    assertThat(node1.getChild(new CollectionItemElementSelector("foo"))).isSameAs(node2);
    assertThat(node2.getParentNode()).isSameAs(node1);
  }
View Full Code Here

      @Override
      public boolean matches(final Object argument)
      {
        if (argument != null && argument instanceof CollectionItemAccessor)
        {
          @SuppressWarnings("TypeMayBeWeakened")
          final CollectionItemAccessor accessor = (CollectionItemAccessor) argument;
          final CollectionItemElementSelector collectionItemElement = new CollectionItemElementSelector(item);
          return accessor.getElementSelector().equals(collectionItemElement);
        }
        return false;
      }
    });
  }
View Full Code Here

TOP

Related Classes of de.danielbechler.diff.access.CollectionItemAccessor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.