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