Class EditorialCostForMapping

java.lang.Object
graphql.schema.diffing.EditorialCostForMapping

public class EditorialCostForMapping extends Object
  • Constructor Details

    • EditorialCostForMapping

      public EditorialCostForMapping()
  • Method Details

    • baseEditorialCostForMapping

      public static int baseEditorialCostForMapping(Mapping mapping, SchemaGraph sourceGraph, SchemaGraph targetGraph)
      Parameters:
      mapping - the mapping
      sourceGraph - the source graph
      targetGraph - 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 mapping
      sourceGraph - the source graph
      targetGraph - the target graph
      editOperationsResult - 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 a Mapping.

      The baseCost argument should be the cost for the fixed mapping from baseEditorialCostForMapping(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 cost
      mapping - the mapping
      sourceGraph - the source graph
      targetGraph - the target graph
      Returns:
      the editorial cost