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 17package androidx.core.os; 18 19import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP; 20 21import androidx.annotation.IntRange; 22import androidx.annotation.NonNull; 23import androidx.annotation.Nullable; 24import androidx.annotation.RestrictTo; 25 26import java.util.Locale; 27 28/** 29 * Interface describing backwards-compatible LocaleList APIs. 30 * 31 * @hide Internal use only 32 */ 33@RestrictTo(LIBRARY_GROUP) 34interface LocaleListInterface { 35 void setLocaleList(@NonNull Locale... list); 36 37 Object getLocaleList(); 38 39 Locale get(int index); 40 41 boolean isEmpty(); 42 43 @IntRange(from = 0) 44 int size(); 45 46 @IntRange(from = -1) 47 int indexOf(Locale locale); 48 49 @Override 50 boolean equals(Object other); 51 52 @Override 53 int hashCode(); 54 55 @Override 56 String toString(); 57 58 String toLanguageTags(); 59 60 @Nullable 61 Locale getFirstMatch(String[] supportedLocales); 62} 63