@Test public void getDeltaProperties() { final FastProperties fastProperties = ctx.getService(FastProperties.class); final Collection<String> fast = ImmutableList.of( "./jcr:content/one", "./jcr:content/two", "./jcr:content/three", "./jcr:content/four", "./jcr:content/five"); final Collection<String> other = ImmutableList.of( "jcr:content/one", "jcr:content/two", "jcr:content/three", "jcr:content/five"); final List<String> actual = fastProperties.getDeltaProperties(fast, other); assertEquals(1, actual.size()); assertEquals("./jcr:content/four", actual.get(0)); }
public List<String> getDeltaProperties(final Collection<String> fastProperties, final Collection<String> otherProperties) { final List<String> delta = new ArrayList<>(); for (final String fastProperty : fastProperties) { boolean found = false; for (String otherProperty : otherProperties) { if (StringUtils.equals( StringUtils.removeStart(fastProperty, "./"), StringUtils.removeStart(otherProperty, "./"))) { found = true; break; } } if (!found) { delta.add(fastProperty); } } return delta; }
FastPropertiesImpl implements FastProperties { public List<String> getDeltaProperties(final Collection<String> fastProperties, final Collection<String> otherProperties) { final List<String> delta = new ArrayList<>(); for (final String fastProperty : fastProperties) { boolean found = false; for (String otherProperty : otherProperties) { if (StringUtils.equals( StringUtils.removeStart(fastProperty, "./"), StringUtils.removeStart(otherProperty, "./"))) { found = true; break; } } if (!found) { delta.add(fastProperty); } } return delta; } }
FastPropertiesImpl implements FastProperties { public List<String> getDeltaProperties(final Collection<String> fastProperties, final Collection<String> otherProperties) { final List<String> delta = new ArrayList<>(); for (final String fastProperty : fastProperties) { boolean found = false; for (String otherProperty : otherProperties) { if (StringUtils.equals( StringUtils.removeStart(fastProperty, "./"), StringUtils.removeStart(otherProperty, "./"))) { found = true; break; } } if (!found) { delta.add(fastProperty); } } return delta; }  }
FastPropertiesImpl implements FastProperties { public List<String> getDeltaProperties(final Collection<String> fastProperties, final Collection<String> otherProperties) { final List<String> delta = new ArrayList<>(); for (final String fastProperty : fastProperties) { boolean found = false; for (String otherProperty : otherProperties) { if (StringUtils.equals( StringUtils.removeStart(fastProperty, "./"), StringUtils.removeStart(otherProperty, "./"))) { found = true; break; } } if (!found) { delta.add(fastProperty); } } return delta; }  @Override final List<String> getFastProperties(); @Override final List<String> getFastProperties(final String indexConfigFlagPropertyName); @Override final List<String> getFastProperties(final List<String> indexConfigFlagPropertyNames); List<String> getDeltaProperties(final Collection<String> fastProperties, final Collection<String> otherProperties); @Override String getFastLabel(final String label); @Override String getSlowLabel(final String label); }
FastPropertiesImpl implements FastProperties { public List<String> getDeltaProperties(final Collection<String> fastProperties, final Collection<String> otherProperties) { final List<String> delta = new ArrayList<>(); for (final String fastProperty : fastProperties) { boolean found = false; for (String otherProperty : otherProperties) { if (StringUtils.equals( StringUtils.removeStart(fastProperty, "./"), StringUtils.removeStart(otherProperty, "./"))) { found = true; break; } } if (!found) { delta.add(fastProperty); } } return delta; }  @Override final List<String> getFastProperties(); @Override final List<String> getFastProperties(final String indexConfigFlagPropertyName); @Override final List<String> getFastProperties(final List<String> indexConfigFlagPropertyNames); List<String> getDeltaProperties(final Collection<String> fastProperties, final Collection<String> otherProperties); @Override String getFastLabel(final String label); @Override String getSlowLabel(final String label);  }