/* * Copyright (C) 2014 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.hardware.camera2.utils; import java.util.List; /** * Various assortment of list utilities. * *
Using a {@code null} list is supported and will almost always return the default value * (e.g. {@code false}, or {@code null}).
*/ public class ListUtils { /** Return {@code} true if the {@code list} contains the {@code needle}. */ public staticChoices with an index closer to 0 get higher priority. If none of the {@code choices}
* are in the {@code list}, then {@code null} is returned.
*
* @param list a list of objects which may or may not contain one or more of the choices
* @param choices an array of objects which should be used to select an item from
*
* @return the first item from {@code choices} contained in {@code list}, otherwise {@code null}
*/
public static