Package graphql.util
Class NodeZipper<T>
- java.lang.Object
-
- graphql.util.NodeZipper<T>
-
@PublicApi public class NodeZipper<T> extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classNodeZipper.ModificationType
-
Constructor Summary
Constructors Constructor Description NodeZipper(T curNode, java.util.List<Breadcrumb<T>> breadcrumbs, NodeAdapter<T> nodeAdapter)NodeZipper(T curNode, java.util.List<Breadcrumb<T>> breadcrumbs, NodeAdapter<T> nodeAdapter, NodeZipper.ModificationType modificationType)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description NodeZipper<T>deleteNode()java.util.List<Breadcrumb<T>>getBreadcrumbs()TgetCurNode()NodeZipper.ModificationTypegetModificationType()TgetParent()NodeZipper<T>insertAfter(T toInsertAfter)NodeZipper<T>insertBefore(T toInsertBefore)NodeZipper<T>modifyNode(java.util.function.Function<T,T> transform)NodeZipper<T>moveUp()static <T> NodeZipper<T>rootZipper(T rootNode, NodeAdapter<T> nodeAdapter)TtoRoot()java.lang.StringtoString()NodeZipper<T>withNewNode(T newNode)
-
-
-
Constructor Detail
-
NodeZipper
public NodeZipper(T curNode, java.util.List<Breadcrumb<T>> breadcrumbs, NodeAdapter<T> nodeAdapter)
-
NodeZipper
public NodeZipper(T curNode, java.util.List<Breadcrumb<T>> breadcrumbs, NodeAdapter<T> nodeAdapter, NodeZipper.ModificationType modificationType)
-
-
Method Detail
-
getModificationType
public NodeZipper.ModificationType getModificationType()
-
getCurNode
public T getCurNode()
-
getBreadcrumbs
public java.util.List<Breadcrumb<T>> getBreadcrumbs()
-
getParent
public T getParent()
-
rootZipper
public static <T> NodeZipper<T> rootZipper(T rootNode, NodeAdapter<T> nodeAdapter)
-
modifyNode
public NodeZipper<T> modifyNode(java.util.function.Function<T,T> transform)
-
deleteNode
public NodeZipper<T> deleteNode()
-
insertAfter
public NodeZipper<T> insertAfter(T toInsertAfter)
-
insertBefore
public NodeZipper<T> insertBefore(T toInsertBefore)
-
withNewNode
public NodeZipper<T> withNewNode(T newNode)
-
moveUp
public NodeZipper<T> moveUp()
-
toRoot
public T toRoot()
- Returns:
- null if it is the root node and marked as deleted, otherwise never null
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-