11package org .schabi .newpipe .settings .preferencesearch ;
22
33import androidx .annotation .NonNull ;
4+ import androidx .annotation .XmlRes ;
45
56import java .util .Arrays ;
67import java .util .List ;
1011 * Represents a preference-item inside the search.
1112 */
1213public class PreferenceSearchItem {
14+ /**
15+ * Key of the setting/preference. E.g. used inside {@link android.content.SharedPreferences}.
16+ */
1317 @ NonNull
1418 private final String key ;
19+ /**
20+ * Title of the setting, e.g. 'Default resolution' or 'Show higher resolutions'.
21+ */
1522 @ NonNull
1623 private final String title ;
24+ /**
25+ * Summary of the setting, e.g. '480p' or 'Only some devices can play 2k/4k'.
26+ */
1727 @ NonNull
1828 private final String summary ;
29+ /**
30+ * Possible entries of the setting, e.g. 480p,720p,...
31+ */
1932 @ NonNull
2033 private final String entries ;
21- @ NonNull
22- private final String keywords ;
34+ /**
35+ * Breadcrumbs - a hint where the setting is located e.g. 'Video and Audio > Player'
36+ */
2337 @ NonNull
2438 private final String breadcrumbs ;
39+ /**
40+ * The xml-resource where this item was found/built from.
41+ */
42+ @ XmlRes
2543 private final int searchIndexItemResId ;
2644
2745 public PreferenceSearchItem (
2846 @ NonNull final String key ,
2947 @ NonNull final String title ,
3048 @ NonNull final String summary ,
3149 @ NonNull final String entries ,
32- @ NonNull final String keywords ,
3350 @ NonNull final String breadcrumbs ,
34- final int searchIndexItemResId
51+ @ XmlRes final int searchIndexItemResId
3552 ) {
3653 this .key = Objects .requireNonNull (key );
3754 this .title = Objects .requireNonNull (title );
3855 this .summary = Objects .requireNonNull (summary );
3956 this .entries = Objects .requireNonNull (entries );
40- this .keywords = Objects .requireNonNull (keywords );
4157 this .breadcrumbs = Objects .requireNonNull (breadcrumbs );
4258 this .searchIndexItemResId = searchIndexItemResId ;
4359 }
@@ -62,10 +78,6 @@ public String getBreadcrumbs() {
6278 return breadcrumbs ;
6379 }
6480
65- public String getKeywords () {
66- return keywords ;
67- }
68-
6981 public int getSearchIndexItemResId () {
7082 return searchIndexItemResId ;
7183 }
@@ -79,8 +91,7 @@ public List<String> getAllRelevantSearchFields() {
7991 getTitle (),
8092 getSummary (),
8193 getEntries (),
82- getBreadcrumbs (),
83- getKeywords ());
94+ getBreadcrumbs ());
8495 }
8596
8697
0 commit comments