public class SubClassMatchStrategy<T extends IMatchable> extends StrategyBase implements IMatchStrategyEqual, IParsedMatchStrategy
TeamOrPersonBase
.
But these temporary matchings always use the default matching.
If one wants to change the default matching for subclass specific
parameters (e.g. family name) this is not possible.
This is an adhoc implementation that may be replaced by a more generic implementation in future.
Especially undecided is the question how to handle class dependend match
modes for the same property path in short cut methods like getMatching()
or #getMatchMode(String)
. Are these needed at all?DEFAULT_PARSED_COLLECTION_MATCH_MODE, DEFAULT_PARSED_MATCH_MATCH_MODE, DEFAULT_PARSED_MATCH_MODE
DEFAULT_COLLECTION_MATCH_MODE, DEFAULT_MATCH_MATCH_MODE, DEFAULT_MATCH_MODE
Modifier and Type | Method and Description |
---|---|
<S extends T> |
addDefaultStrategyForClass(java.lang.Class<S> clazz) |
Matching |
getMatching()
Returns the Matching of this match strategy
|
protected java.util.UUID |
getUuid() |
<S extends IMatchable> |
invoke(S matchFirst,
S matchSecond)
Invokes the match check.
|
<S extends IMatchable> |
invoke(S matchFirst,
S matchSecond,
MatchResult matchResult,
boolean failAll) |
<T extends IMatchable> |
invoke(T matchFirst,
T matchSecond,
boolean failAll) |
static <T extends IMatchable> |
NewInstance(java.lang.Class<T> baseClass) |
static <T extends IMatchable,S extends T> |
NewInstance(java.lang.Class<T> baseClass,
java.lang.Class<? extends T>... subClasses) |
void |
putStrategy(java.lang.Class<? extends T> clazz,
IMatchStrategy strategy) |
void |
setMatchMode(java.lang.Class<? extends T> clazz,
java.lang.String propertyName,
MatchMode matchMode) |
void |
setMatchMode(java.lang.Class<? extends T> clazz,
java.lang.String propertyName,
MatchMode matchMode,
IMatchStrategyEqual matchStrategy) |
void |
setMatchMode(java.lang.String propertyName,
MatchMode matchMode)
Deprecated.
deprecated in this class, use
setMatchMode(Class, String, MatchMode)
instead. |
void |
setMatchMode(java.lang.String propertyName,
MatchMode matchMode,
IMatchStrategy matchStrategy)
Deprecated.
|
isBlank, isCollection, isNotBlank, isPrimitive, isSingleCdmBaseObject, isUserType, Nz
public static <T extends IMatchable> SubClassMatchStrategy<T> NewInstance(java.lang.Class<T> baseClass)
@SafeVarargs public static <T extends IMatchable,S extends T> SubClassMatchStrategy<T> NewInstance(java.lang.Class<T> baseClass, java.lang.Class<? extends T>... subClasses) throws MatchException
MatchException
public <S extends T> void addDefaultStrategyForClass(java.lang.Class<S> clazz) throws MatchException
MatchException
public void putStrategy(java.lang.Class<? extends T> clazz, IMatchStrategy strategy) throws MatchException
MatchException
protected java.util.UUID getUuid()
getUuid
in class StrategyBase
@Deprecated public void setMatchMode(java.lang.String propertyName, MatchMode matchMode) throws MatchException
setMatchMode(Class, String, MatchMode)
instead.setMatchMode
in interface IMatchStrategy
setMatchMode
in interface IMatchStrategyEqual
MatchException
#setMatchMode(String, MatchMode, IMatchStrategy)}
public void setMatchMode(java.lang.Class<? extends T> clazz, java.lang.String propertyName, MatchMode matchMode) throws MatchException
MatchException
@Deprecated public void setMatchMode(java.lang.String propertyName, MatchMode matchMode, IMatchStrategy matchStrategy) throws MatchException
match mode
is none of
the 4 MATCH* match modes like MatchMode.MATCH
or MatchMode.MATCH_REQUIRED
.
* @deprecated deprecated in this class, use #setMatchMode(String, MatchMode, IMatchStrategyEqual)
instead.setMatchMode
in interface IMatchStrategy
setMatchMode
in interface IMatchStrategyEqual
MatchException
#setMatchMode(String, MatchMode)}
public void setMatchMode(java.lang.Class<? extends T> clazz, java.lang.String propertyName, MatchMode matchMode, IMatchStrategyEqual matchStrategy) throws MatchException
MatchException
public <S extends IMatchable> MatchResult invoke(S matchFirst, S matchSecond) throws MatchException
invoke
in interface IMatchStrategy
invoke
in interface IMatchStrategyEqual
invoke
in interface IParsedMatchStrategy
matchFirst
- The more complete instancematchSecond
- The parsed instance having only few attributes definedMatchException
public <T extends IMatchable> MatchResult invoke(T matchFirst, T matchSecond, boolean failAll) throws MatchException
invoke
in interface IMatchStrategy
MatchException
public <S extends IMatchable> void invoke(S matchFirst, S matchSecond, MatchResult matchResult, boolean failAll) throws MatchException
invoke
in interface IMatchStrategy
MatchException
public Matching getMatching()
getMatching
in interface IMatchStrategy
getMatching
in interface IMatchStrategyEqual
Copyright © 2007-2020 EDIT. All Rights Reserved.