public class Patch extends Object implements org.springframework.data.util.Streamable<PatchOperation>
Represents a Patch.
This class (and PatchOperation
capture the definition of a patch, but are not coupled to any specific patch
representation.
Constructor and Description |
---|
Patch(List<PatchOperation> operations,
BindContext context) |
Modifier and Type | Method and Description |
---|---|
<T> List<T> |
apply(List<T> in,
Class<T> type)
Applies the Patch to a given List of objects.
|
<T> T |
apply(T in,
Class<T> type)
Applies the Patch to a given Object graph.
|
Iterator<PatchOperation> |
iterator() |
int |
size() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
and, and, and, and, empty, filter, flatMap, get, isEmpty, map, of, of, of, stream, toList, toSet, toStreamable, toStreamable
forEach, spliterator
public Patch(List<PatchOperation> operations, BindContext context)
public int size()
public <T> T apply(T in, Class<T> type) throws PatchException
T
- the object type.in
- The object graph to apply the patch to.type
- The object type.PatchException
- if there are any errors while applying the patch.public <T> List<T> apply(List<T> in, Class<T> type) throws PatchException
T
- the list's generic type.in
- The list to apply the patch to.type
- The list's generic type.PatchException
- if there are any errors while applying the patch.public Iterator<PatchOperation> iterator()
iterator
in interface Iterable<PatchOperation>
Copyright © 2011–2023 Pivotal Software, Inc.. All rights reserved.