1
|
/**
|
2
|
* Copyright (C) 2007 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8
|
*/
|
9
|
|
10
|
package eu.etaxonomy.cdm.strategy.match;
|
11
|
|
12
|
import java.util.Set;
|
13
|
|
14
|
|
15
|
/**
|
16
|
* @author a.mueller
|
17
|
* @created 31.07.2009
|
18
|
* @version 1.0
|
19
|
*/
|
20
|
public interface IMatchStrategy {
|
21
|
|
22
|
public static MatchMode defaultMatchMode = MatchMode.EQUAL;
|
23
|
public static MatchMode defaultCollectionMatchMode = MatchMode.IGNORE;
|
24
|
public static MatchMode defaultMatchMatchMode = MatchMode.MATCH;
|
25
|
|
26
|
public MatchMode getMatchMode(String propertyName);
|
27
|
|
28
|
/**
|
29
|
* Sets the match mode for property propertyName
|
30
|
* @param propertyName
|
31
|
* @param mergeMode
|
32
|
* @throws MatchException
|
33
|
*/
|
34
|
public void setMatchMode(String propertyName, MatchMode matchMode) throws MatchException;
|
35
|
|
36
|
/**
|
37
|
* Invokes the match check.
|
38
|
* If two objects match this method returns true, false otherwise
|
39
|
* @param <T>
|
40
|
* @param mergeFirst
|
41
|
* @param mergeSecond
|
42
|
* @throws MatchException
|
43
|
*/
|
44
|
public <T extends IMatchable> boolean invoke(T matchFirst, T matchSecond) throws MatchException;
|
45
|
|
46
|
|
47
|
/**
|
48
|
* Returns the Matching of this match strategy
|
49
|
* @return
|
50
|
*/
|
51
|
public Matching getMatching();
|
52
|
|
53
|
/**
|
54
|
* Returns the class this match strategy matches for
|
55
|
* @return
|
56
|
*/
|
57
|
public Class getMatchClass();
|
58
|
|
59
|
/**
|
60
|
* Returns a map containing all fields this match strategy defines match modes for
|
61
|
* @return
|
62
|
*/
|
63
|
public Set<String> getMatchFieldPropertyNames();
|
64
|
}
|