Package com.linkedin.data.transform.patch

Examples of com.linkedin.data.transform.patch.Patch


    PatchTree update = PatchCreator.diff(g1, g2);

    assertEquals(update.toString(), "{$delete=[description]}");
    assertFalse(g1.equals(g2));

    DataComplexProcessor processor = new DataComplexProcessor(new Patch(), update.getDataMap(), g1.data());
    processor.run(false);

    assertEquals(g1, g2);
  }
View Full Code Here


    g2.setName("Some Group");
    PatchTree update = PatchCreator.diff(g1, g2);
    assertEquals(update.toString(), "{$set={id=42, name=Some Group}}");
    assertFalse(g1.equals(g2));

    DataComplexProcessor processor = new DataComplexProcessor(new Patch(), update.getDataMap(), g1.data());
    processor.run(false);

    assertEquals(g1, g2);
  }
View Full Code Here

    g2.data().put("$foo", "value");
    PatchTree update = PatchCreator.diff(g1, g2);
    assertEquals(update.toString(), "{$set={$foo=value}}");
    assertFalse(g1.equals(g2));

    DataComplexProcessor processor = new DataComplexProcessor(new Patch(), update.getDataMap(), g1.data());
    processor.run(false);

    assertEquals(g1, g2);
  }
View Full Code Here

    ((DataMap)g2.data().get("$foo")).put("bar", 42);
    PatchTree update = PatchCreator.diff(g1, g2);
    assertEquals(update.toString(), "{$$foo={$set={bar=42}}}");
    assertFalse(g1.equals(g2));

    DataComplexProcessor processor = new DataComplexProcessor(new Patch(), update.getDataMap(), g1.data());
    processor.run(false);

    assertEquals(g1, g2);
  }
View Full Code Here

{
  public static <T extends RecordTemplate> void applyPatch(T original,
                                                           PatchRequest<T> patch) throws DataProcessingException
  {
    DataComplexProcessor processor =
        new DataComplexProcessor(new Patch(), patch.getPatchDocument(), original.data());
    processor.run(false);
  }
View Full Code Here

TOP

Related Classes of com.linkedin.data.transform.patch.Patch

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.