Here you can find the source of isAcceptedCountry(String country, List
Parameter | Description |
---|
public static boolean isAcceptedCountry(String country, List<String> countryInclude, List<String> countryExclude)
//package com.java2s; //License from project: Apache License import java.util.List; public class Main { /**/*from www .j a v a2 s .co m*/ * Return if a country is accepted * * @param * @return */ public static boolean isAcceptedCountry(String country, List<String> countryInclude, List<String> countryExclude) { if (country == null || "".equals(country)) return true; country = country.toLowerCase(); if (countryInclude != null && countryInclude.size() > 0 && !"".equals(countryInclude.get(0))) { if (countryInclude.contains(country)) return true; return false; } if (countryExclude != null && countryExclude.size() > 0 && !"".equals(countryExclude.get(0))) { if (countryExclude.contains(country)) return false; return true; } return true; } }