Class MatchingStrategies

java.lang.Object
org.modelmapper.convention.MatchingStrategies

public class MatchingStrategies extends Object
MatchingStrategy implementations. Matching strategies identify source to destination property matches by comparing source and destination type, property and property type names which are converted and tokenized prior to matching.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final MatchingStrategy
    A matching strategy that allows for source properties to be loosely matched to destination properties by requiring that only the last destination property in a hierarchy be matched.
    static final MatchingStrategy
    A matching strategy that allows for source properties to be intelligently matched to destination properties, requiring that all destination properties be matched and all source property names have at least one token matched.
    static final MatchingStrategy
    A matching strategy that allows for source properties to be strictly matched to destination properties.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • LOOSE

      public static final MatchingStrategy LOOSE
      A matching strategy that allows for source properties to be loosely matched to destination properties by requiring that only the last destination property in a hierarchy be matched. The following rules apply:
      • Tokens can be matched in any order
      • The last destination property name must have all tokens matched
      • The last source property name must have at least one token matched
    • STANDARD

      public static final MatchingStrategy STANDARD
      A matching strategy that allows for source properties to be intelligently matched to destination properties, requiring that all destination properties be matched and all source property names have at least one token matched. The following rules apply:
      • Tokens can be matched in any order
      • All destination property name tokens must be matched
      • All source property names must have at least one token matched
      • Tokens can be combined and matched in order
    • STRICT

      public static final MatchingStrategy STRICT
      A matching strategy that allows for source properties to be strictly matched to destination properties. This strategy allows for complete matching accuracy, ensuring that no mismatches or ambiguity occurs. But it requires that property name tokens on the source and destination side match each other precisely. The following rules apply:
      • Tokens are matched in strict order
      • All destination property name tokens must be matched
      • All source property names must have all tokens matched
  • Constructor Details

    • MatchingStrategies

      public MatchingStrategies()