Class PartialStructRule

java.lang.Object
nz.org.riskscape.engine.types.eqrule.PartialStructRule
All Implemented Interfaces:
Identified, EquivalenceRule

public class PartialStructRule extends Object implements EquivalenceRule
  • Constructor Details

    • PartialStructRule

      public PartialStructRule()
  • Method Details

    • getCoercer

      public Optional<Coercer> getCoercer(TypeRules typeRules, Type sourceType, Type targetType)
      Specified by:
      getCoercer in interface EquivalenceRule
    • describeMismatch

      public static List<Problem> describeMismatch(TypeSet typeset, Struct given, Struct expected)

      Drills down into why a struct mismatch occurred. As the user data can often contain a lot of struct members, it helps to pinpoint which struct members in particular we didn't like.

      Parameters:
      given - the struct data provided by the user
      expected - what was expected (i.e. by a function)
      Returns:
      a list of Problems that describe the mismatch