Java List from Array arrayContainsValue(final String[] list, final String value)

Here you can find the source of arrayContainsValue(final String[] list, final String value)

Description

array Contains Value

License

Open Source License

Declaration

public static boolean arrayContainsValue(final String[] list,
            final String value) 

Method Source Code

//package com.java2s;
/*//from  ww w.j  av a2s  . c o m
 * Sentilo
 * 
 * Copyright (C) 2013 Institut Municipal d?Inform?tica, Ajuntament de Barcelona.
 * 
 * This program is licensed and may be used, modified and redistributed under the terms of the
 * European Public License (EUPL), either version 1.1 or (at your option) any later version as soon
 * as they are approved by the European Commission.
 * 
 * Alternatively, you may redistribute and/or modify this program under the terms of the GNU Lesser
 * General Public License as published by the Free Software Foundation; either version 3 of the
 * License, or (at your option) any later version.
 * 
 * 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 licenses for the specific language governing permissions, limitations and more details.
 * 
 * You should have received a copy of the EUPL1.1 and the LGPLv3 licenses along with this program;
 * if not, you may find them at:
 * 
 * https://joinup.ec.europa.eu/software/page/eupl/licence-eupl http://www.gnu.org/licenses/ and
 * https://www.gnu.org/licenses/lgpl.txt
 */

import java.util.Arrays;
import java.util.List;

public class Main {
    public static boolean arrayContainsValue(final String[] list,
            final String value) {
        final List<String> valuesList = Arrays.asList(list);
        return valuesList.contains(value);
    }
}

Related

  1. arrayAsArrayList(E... elements)
  2. arrayAsList(Object value)
  3. arrayAsList(Object[] array)
  4. arrayAsListCopy(T... array)
  5. arrayAsListEmptyIfNull(T[] array)
  6. arrayMaxInt(final List array)
  7. arrayOf(List objs)
  8. arrayToFixedSizeList(final T[] array)
  9. arrayToInSQL(String column, List list)

    HOME | Copyright © www.java2s.com 2016