Package graphql.schema.diffing
Class EditorialCostForMapping
java.lang.Object
graphql.schema.diffing.EditorialCostForMapping
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int
baseEditorialCostForMapping
(Mapping mapping, SchemaGraph sourceGraph, SchemaGraph targetGraph) static int
baseEditorialCostForMapping
(Mapping mapping, SchemaGraph sourceGraph, SchemaGraph targetGraph, 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
.
-
Constructor Details
-
EditorialCostForMapping
public EditorialCostForMapping()
-
-
Method Details
-
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
public static int baseEditorialCostForMapping(Mapping mapping, SchemaGraph sourceGraph, SchemaGraph targetGraph, 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
-