public static int indexOf(double[] array, double valueToFind, int startIndex) { if (isEmpty(array)) { return INDEX_NOT_FOUND; } if (startIndex < 0) { startIndex = 0; } for (int i = startIndex; i < array.length; i++) { if (valueToFind == array[i]) { return i; } } return INDEX_NOT_FOUND; }
public static int lastIndexOf(float[] array, float valueToFind, int startIndex) { if (isEmpty(array)) { return INDEX_NOT_FOUND; } if (startIndex < 0) { return INDEX_NOT_FOUND; } else if (startIndex >= array.length) { startIndex = array.length - 1; } for (int i = startIndex; i >= 0; i--) { if (valueToFind == array[i]) { return i; } } return INDEX_NOT_FOUND; }
public static int indexOf(boolean[] array, boolean valueToFind, int startIndex) { if (isEmpty(array)) { return INDEX_NOT_FOUND; } if (startIndex < 0) { startIndex = 0; } for (int i = startIndex; i < array.length; i++) { if (valueToFind == array[i]) { return i; } } return INDEX_NOT_FOUND; }
public static int indexOf(float[] array, float valueToFind, int startIndex) { if (isEmpty(array)) { return INDEX_NOT_FOUND; } if (startIndex < 0) { startIndex = 0; } for (int i = startIndex; i < array.length; i++) { if (valueToFind == array[i]) { return i; } } return INDEX_NOT_FOUND; }
public static int lastIndexOf(double[] array, double valueToFind, int startIndex) { if (isEmpty(array)) { return INDEX_NOT_FOUND; } if (startIndex < 0) { return INDEX_NOT_FOUND; } else if (startIndex >= array.length) { startIndex = array.length - 1; } for (int i = startIndex; i >= 0; i--) { if (valueToFind == array[i]) { return i; } } return INDEX_NOT_FOUND; }
public static int lastIndexOf(boolean[] array, boolean valueToFind, int startIndex) { if (isEmpty(array)) { return INDEX_NOT_FOUND; } if (startIndex < 0) { return INDEX_NOT_FOUND; } else if (startIndex >= array.length) { startIndex = array.length - 1; } for (int i = startIndex; i >= 0; i--) { if (valueToFind == array[i]) { return i; } } return INDEX_NOT_FOUND; }
@Override public String getHeader(String name){ Header[] headers = httpResponse.getHeaders(name); return Arrays2.isEmpty(headers) ? null : headers[0].getValue(); }
@Override public String getHeader(String name) { Header[] headers = response.getHeaders(name); return Arrays2.isEmpty(headers) ? null : headers[0].getValue(); }
protected DbTable[] tables(MetaApi api, DbTable[] tables) { if (!Arrays2.isEmpty(api.getGenIncludeTables())) { List<DbTable> list = new ArrayList<>(); for (DbTable table : tables) { if (contains(table, api.getGenIncludeTables())) { list.add(table); } } return list.toArray(new DbTable[0]); } if (!Arrays2.isEmpty(api.getGenExcludeTables())) { List<DbTable> list = new ArrayList<>(); for (DbTable table : tables) { if (!contains(table, api.getGenExcludeTables())) { list.add(table); } } return list.toArray(new DbTable[0]); } return tables; }
public DbTable(String catalog, String schema, String name, String type, boolean quoted, String comment, String primaryKeyName, String[] primaryKeyColumnNames, DbColumn[] columns, DbForeignKey[] foreignKeys, DbIndex[] indexes) { super(catalog, schema, name, quoted); Args.notEmpty(type,"table type"); Args.notEmpty(columns,"columns' of table '" + name + ""); Args.assertFalse(!Arrays2.isEmpty(primaryKeyColumnNames) && Strings.isEmpty(primaryKeyName), "primaryKeyName must not be empty if primary key exists"); this.type = type; this.comment = comment; this.columns = columns; this.foreignKeys = null == foreignKeys ? new DbForeignKey[]{} : foreignKeys; this.indexes = null == indexes ? new DbIndex[]{} : indexes; this.primaryKey = Arrays2.isEmpty(primaryKeyColumnNames) ? null : new DbPrimaryKey(primaryKeyName, primaryKeyColumnNames); this.primaryKeyColumns = fromNames(primaryKeyColumnNames); }
if (isIgnoreEmptyArray() && Arrays2.isEmpty((Object[]) val)) { continue;
Arrays2.isEmpty(((EnumerablePropertySource) propertySource).getPropertyNames())) { return;
protected void register(EventListenerRegistration reg,BeanDefinition bd){ String[] categories = reg.getCategories(); String[] eventNames = reg.getEventNames(); if(Arrays2.isEmpty(categories) && Arrays2.isEmpty(eventNames)){ throw new EventRegistrationException("'categories' or 'eventNames' must be defined in listener registration, source : " + bd.getSource()); } EventListener listener = reg.getListener(); if(null != categories){ for(String category : categories){ if(!eventManager.isEventCategoryRegistered(category)){ throw new EventRegistrationException("event category '" + category + "' not register, make sure you type the correct name, source : " + bd.getSource()); } eventManager.addEventCategoryListener(category, listener); } } if(null != eventNames){ for(String eventName : eventNames){ if(!eventManager.isEventNameRegistered(eventName)){ throw new EventRegistrationException("event name '" + eventName + "' not register, make sure you type the correct name, source : " + bd.getSource()); } eventManager.addEventNameListener(eventName, listener); } } } }
Context.InitialProfileResolver externalResolver = Context.get().getInitialProfileResolver(); String[] profiles = null == externalResolver ? null : externalResolver.getProfiles(); if(!Arrays2.isEmpty(profiles)) { return profiles;