Remove the Builder
Change-Id: Idef22e6a82d59e3ec95b95ad237debcb07daf000
This commit is contained in:
parent
33cc825374
commit
eda7d8af60
1 changed files with 2 additions and 31 deletions
|
@ -76,35 +76,6 @@ public class SuggestedWords {
|
||||||
+ " mIsPunctuationSuggestions=" + mIsPunctuationSuggestions;
|
+ " mIsPunctuationSuggestions=" + mIsPunctuationSuggestions;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class Builder {
|
|
||||||
private final boolean mTypedWordValid;
|
|
||||||
private final boolean mHasMinimalSuggestion;
|
|
||||||
private final boolean mIsPunctuationSuggestions;
|
|
||||||
private final boolean mShouldBlockAutoCorrectionBySafetyNet;
|
|
||||||
private final boolean mAllowsToBeAutoCorrected;
|
|
||||||
private final List<SuggestedWordInfo> mSuggestedWordInfoList;
|
|
||||||
|
|
||||||
private Builder(final List<SuggestedWordInfo> suggestedWordInfoList,
|
|
||||||
final boolean typedWordValid,
|
|
||||||
final boolean hasMinimalSuggestion,
|
|
||||||
final boolean allowsToBeAutoCorrected,
|
|
||||||
final boolean isPunctuationSuggestions,
|
|
||||||
final boolean shouldBlockAutoCorrectionBySafetyNet) {
|
|
||||||
mSuggestedWordInfoList = suggestedWordInfoList;
|
|
||||||
mTypedWordValid = typedWordValid;
|
|
||||||
mHasMinimalSuggestion = hasMinimalSuggestion;
|
|
||||||
mAllowsToBeAutoCorrected = allowsToBeAutoCorrected;
|
|
||||||
mIsPunctuationSuggestions = isPunctuationSuggestions;
|
|
||||||
mShouldBlockAutoCorrectionBySafetyNet = shouldBlockAutoCorrectionBySafetyNet;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SuggestedWords build() {
|
|
||||||
return new SuggestedWords(mSuggestedWordInfoList, mTypedWordValid,
|
|
||||||
mHasMinimalSuggestion, mAllowsToBeAutoCorrected,
|
|
||||||
mIsPunctuationSuggestions, mShouldBlockAutoCorrectionBySafetyNet);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static SuggestedWords getSuggestedWords(
|
public static SuggestedWords getSuggestedWords(
|
||||||
final List<SuggestedWordInfo> suggestedWordInfoList,
|
final List<SuggestedWordInfo> suggestedWordInfoList,
|
||||||
final boolean typedWordValid,
|
final boolean typedWordValid,
|
||||||
|
@ -112,12 +83,12 @@ public class SuggestedWords {
|
||||||
final boolean allowsToBeAutoCorrected,
|
final boolean allowsToBeAutoCorrected,
|
||||||
final boolean isPunctuationSuggestions,
|
final boolean isPunctuationSuggestions,
|
||||||
final boolean shouldBlockAutoCorrectionBySafetyNet) {
|
final boolean shouldBlockAutoCorrectionBySafetyNet) {
|
||||||
return new Builder(suggestedWordInfoList,
|
return new SuggestedWords(suggestedWordInfoList,
|
||||||
typedWordValid,
|
typedWordValid,
|
||||||
hasMinimalSuggestion,
|
hasMinimalSuggestion,
|
||||||
allowsToBeAutoCorrected,
|
allowsToBeAutoCorrected,
|
||||||
isPunctuationSuggestions,
|
isPunctuationSuggestions,
|
||||||
shouldBlockAutoCorrectionBySafetyNet).build();
|
shouldBlockAutoCorrectionBySafetyNet);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ArrayList<SuggestedWordInfo> getFromCharSequenceList(
|
public static ArrayList<SuggestedWordInfo> getFromCharSequenceList(
|
||||||
|
|
Loading…
Reference in a new issue