1 /* 2 * Copyright (C) 2017 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package androidx.core.os; 18 19 import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP; 20 21 import androidx.annotation.IntRange; 22 import androidx.annotation.NonNull; 23 import androidx.annotation.Nullable; 24 import androidx.annotation.RestrictTo; 25 26 import java.util.Locale; 27 28 /** 29 * Interface describing backwards-compatible LocaleList APIs. 30 * 31 * @hide Internal use only 32 */ 33 @RestrictTo(LIBRARY_GROUP) 34 interface LocaleListInterface { setLocaleList(@onNull Locale... list)35 void setLocaleList(@NonNull Locale... list); 36 getLocaleList()37 Object getLocaleList(); 38 get(int index)39 Locale get(int index); 40 isEmpty()41 boolean isEmpty(); 42 43 @IntRange(from = 0) size()44 int size(); 45 46 @IntRange(from = -1) indexOf(Locale locale)47 int indexOf(Locale locale); 48 49 @Override equals(Object other)50 boolean equals(Object other); 51 52 @Override hashCode()53 int hashCode(); 54 55 @Override toString()56 String toString(); 57 toLanguageTags()58 String toLanguageTags(); 59 60 @Nullable getFirstMatch(String[] supportedLocales)61 Locale getFirstMatch(String[] supportedLocales); 62 } 63