Package graphql.schema.diffing
Class Mapping
- java.lang.Object
-
- graphql.schema.diffing.Mapping
-
public class Mapping extends java.lang.Object
A mapping (in the math sense) from a list of vertices to another list of vertices. A mapping can semantically mean a change, but doesn't have to: a vertex can be mapped to the same vertex (semantically the same, Java object wise they are different).
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(Vertex source, Vertex target)
boolean
contains(Vertex vertex, boolean sourceOrTarget)
boolean
containsSource(Vertex sourceVertex)
boolean
containsTarget(Vertex targetVertex)
Mapping
copy()
Mapping
copyMappingWithLastElementRemoved()
Mapping
extendMapping(Vertex source, Vertex target)
int
fixedSize()
void
forEachNonFixedSourceAndTarget(java.util.function.BiConsumer<? super Vertex,? super Vertex> consumer)
void
forEachNonFixedTarget(java.util.function.Consumer<? super Vertex> action)
void
forEachTarget(java.util.function.Consumer<? super Vertex> action)
Vertex
getParentRestriction(Vertex v)
Vertex
getSource(int i)
Vertex
getSource(Vertex target)
Vertex
getTarget(int i)
Vertex
getTarget(Vertex source)
boolean
hasParentRestriction(Vertex v)
Mapping
invert()
static Mapping
newMapping(java.util.Map<Vertex,Vertex> fixedParentRestrictions, com.google.common.collect.BiMap<Vertex,Vertex> fixedMappings, java.util.List<Vertex> fixedSourceList, java.util.List<Vertex> fixedTargetList)
int
nonFixedSize()
int
size()
-
-
-
Method Detail
-
newMapping
public static Mapping newMapping(java.util.Map<Vertex,Vertex> fixedParentRestrictions, com.google.common.collect.BiMap<Vertex,Vertex> fixedMappings, java.util.List<Vertex> fixedSourceList, java.util.List<Vertex> fixedTargetList)
-
hasParentRestriction
public boolean hasParentRestriction(Vertex v)
-
getSource
public Vertex getSource(int i)
-
getTarget
public Vertex getTarget(int i)
-
containsSource
public boolean containsSource(Vertex sourceVertex)
-
containsTarget
public boolean containsTarget(Vertex targetVertex)
-
contains
public boolean contains(Vertex vertex, boolean sourceOrTarget)
-
size
public int size()
-
fixedSize
public int fixedSize()
-
nonFixedSize
public int nonFixedSize()
-
copyMappingWithLastElementRemoved
public Mapping copyMappingWithLastElementRemoved()
-
copy
public Mapping copy()
-
forEachTarget
public void forEachTarget(java.util.function.Consumer<? super Vertex> action)
-
forEachNonFixedTarget
public void forEachNonFixedTarget(java.util.function.Consumer<? super Vertex> action)
-
forEachNonFixedSourceAndTarget
public void forEachNonFixedSourceAndTarget(java.util.function.BiConsumer<? super Vertex,? super Vertex> consumer)
-
invert
public Mapping invert()
-
-