Package graphql.schema.diffing
Class EditorialCostForMapping
- java.lang.Object
-
- graphql.schema.diffing.EditorialCostForMapping
-
public class EditorialCostForMapping extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description EditorialCostForMapping()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
baseEditorialCostForMapping(Mapping mapping, SchemaGraph sourceGraph, SchemaGraph targetGraph)
static int
baseEditorialCostForMapping(Mapping mapping, SchemaGraph sourceGraph, SchemaGraph targetGraph, java.util.List<EditOperation> editOperationsResult)
Gets the "editorial cost for mapping" for the base mapping.static int
editorialCostForMapping(int baseCost, Mapping mapping, SchemaGraph sourceGraph, SchemaGraph targetGraph)
Calculates the "editorial cost for mapping" for the non-fixed targets in aMapping
.
-
-
-
Method Detail
-
baseEditorialCostForMapping
public static int baseEditorialCostForMapping(Mapping mapping, SchemaGraph sourceGraph, SchemaGraph targetGraph)
- Parameters:
mapping
- the mappingsourceGraph
- the source graphtargetGraph
- the target graph- Returns:
- the editorial cost
- See Also:
baseEditorialCostForMapping(Mapping, SchemaGraph, SchemaGraph, List)
-
baseEditorialCostForMapping
public static int baseEditorialCostForMapping(Mapping mapping, SchemaGraph sourceGraph, SchemaGraph targetGraph, java.util.List<EditOperation> editOperationsResult)
Gets the "editorial cost for mapping" for the base mapping.Use this is as base cost when invoking
editorialCostForMapping(int, Mapping, SchemaGraph, SchemaGraph)
as it heavily speeds up performance.- Parameters:
mapping
- the mappingsourceGraph
- the source graphtargetGraph
- the target grapheditOperationsResult
- the list of edit operations- Returns:
- the editorial cost
-
editorialCostForMapping
public static int editorialCostForMapping(int baseCost, Mapping mapping, SchemaGraph sourceGraph, SchemaGraph targetGraph)
Calculates the "editorial cost for mapping" for the non-fixed targets in aMapping
.The
baseCost
argument should be the cost for the fixed mapping frombaseEditorialCostForMapping(Mapping, SchemaGraph, SchemaGraph)
.The sum of the non-fixed costs and the fixed costs is total editorial cost for mapping.
- Parameters:
baseCost
- the starting base costmapping
- the mappingsourceGraph
- the source graphtargetGraph
- the target graph- Returns:
- the editorial cost
-
-