Here you can find the source of isListBased(Class type)
Parameter | Description |
---|---|
type | Type to check |
public static boolean isListBased(Class type)
//package com.java2s; /********************************************************************** Copyright (c) 2004 Andy Jefferson and others. All rights reserved. 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.//from ww w.j a va 2 s . co m Contributors: 2007 Xuan Baldauf - Make error message "023011" a little bit more verbose ... **********************************************************************/ public class Main { /** * Return whether the supplied type (collection) is list based. * @param type Type to check * @return Whether it needs list ordering */ public static boolean isListBased(Class type) { if (type == null) { return false; } else if (java.util.List.class.isAssignableFrom(type)) { return true; } else if (java.util.Queue.class.isAssignableFrom(type)) { // Queue needs ordering return true; } return false; } }