prepareTMQuery(List<String> contents,
HasSearchType.SearchType searchType, MergeOptions opts,
String resId) {
if (opts == null) {
return new TransMemoryQuery(contents, searchType,
new TransMemoryQuery.Condition(false, projectSlug),
new TransMemoryQuery.Condition(false, docId),
new TransMemoryQuery.Condition(false, resId));
} else {
TransMemoryQuery.Condition projectCondition =
new TransMemoryQuery.Condition(
opts.getDifferentProject() == MergeRule.REJECT,
projectSlug);
TransMemoryQuery.Condition documentCondition =
new TransMemoryQuery.Condition(
opts.getDifferentDocument() == MergeRule.REJECT,
docId);
TransMemoryQuery.Condition resCondition =
new TransMemoryQuery.Condition(
opts.getDifferentResId() == MergeRule.REJECT, resId);
return new TransMemoryQuery(contents, searchType, projectCondition,
documentCondition, resCondition);
}
}