public static final <T> List<T> combine(List<T> list1, List<T> list2, List<T> list3) { List<T> combined = new ArrayList<T>(); combined.addAll(toEmptyList(list1)); combined.addAll(toEmptyList(list2)); combined.addAll(toEmptyList(list3)); return combined; }
/** * Get an unmodifiable list from the single element. Return emptyList() if element is null. * * @deprecated Use CollectionUtils.singletonList() instead */ @Deprecated public static <T> List<T> unmodifiableList(T element) { List<T> list = toEmptyList(element); return Collections.unmodifiableList(list); }
public static final boolean isSingleWildcardMatch(String s, List<String> patterns) { for (String pattern : CollectionUtils.toEmptyList(patterns)) { if (isSingleWildcardMatch(s, pattern)) { return true; } } return false; }
@Override public Properties getProperties(String configId, Properties overrides) { return getProperties(CollectionUtils.toEmptyList(configId), overrides); }
public static final void executeProcessors(Properties properties, List<PropertyProcessor> processors) { for (PropertyProcessor processor : CollectionUtils.toEmptyList(processors)) { processor.process(properties); } }
public static final List<String> sortedMerge(List<String> list, String csv) { Set<String> set = new TreeSet<String>(); set.addAll(toEmptyList(list)); set.addAll(getTrimmedListFromCSV(csv)); return new ArrayList<String>(set); }
public static final Properties combine(Properties properties, List<Properties> list) { List<Properties> newList = new ArrayList<Properties>(CollectionUtils.toEmptyList(list)); newList.add(0, toEmpty(properties)); return combine(newList); }
@Override public void nullify() { Assert.notNull(schema, "schema is null"); for (Table table : CollectionUtils.toEmptyList(schema.getTables())) { for (Column column : CollectionUtils.toEmptyList(table.getColumns())) { nullify(column); } for (Index index : CollectionUtils.toEmptyList(table.getIndices())) { nullify(index); } } }
protected void log(ScmExecutable exec) { ScmRequest request = org.kuali.common.util.ScmUtils.cloneOrNew(exec.getRequest()); String adds = FormatUtils.getCount(CollectionUtils.toEmptyList(request.getAdds()).size()); String deletes = FormatUtils.getCount(CollectionUtils.toEmptyList(request.getDeletes()).size()); String commits = FormatUtils.getCount(CollectionUtils.toEmptyList(request.getCommits()).size()); logger.info(" -- SCM --"); logger.info("Adds: {}", adds); logger.info("Deletes: {}", deletes); logger.info("Commits: {}", commits); logger.info("Skip: {}", skip); }
public String cp(List<String> options, String src, String dst, boolean bypassAnyAliases) { Assert.hasText(src, "src has no text"); Assert.hasText(dst, "dst has no text"); List<String> args = new ArrayList<String>(); args.addAll(CollectionUtils.toEmptyList(options)); args.add(src); args.add(dst); return cmd(CP, args, bypassAnyAliases); }
/** * This is a copy constructor. It must create a perfect, deep, copy of this object */ public Constraint(Constraint constraint) { this.name = constraint.getName(); this.columnNames = new ArrayList<String>(CollectionUtils.toEmptyList(constraint.getColumnNames())); }
public ContextConfig(ContextConfig config) { super(); this.id = config.getId(); for (Location location : CollectionUtils.toEmptyList(config.getLocations())) { this.locations.add(new Location(location)); } for (ContextConfig child : CollectionUtils.toEmptyList(config.getContexts())) { this.contexts.add(new ContextConfig(child)); } }
public static List<String> getPrimaryKeyColumnNames(Table t) { List<String> names = new ArrayList<String>(); for (Column col : CollectionUtils.toEmptyList(t.getColumns())) { if (col.isPrimaryKey()) { names.add(col.getName()); } } return names; }
public ProjectConfigContainer(ProjectConfigContainer config) { super(); this.groupId = config.getGroupId(); this.artifactId = config.getArtifactId(); for (Location location : CollectionUtils.toEmptyList(config.getLocations())) { this.locations.add(new Location(location)); } for (ContextConfig context : CollectionUtils.toEmptyList(config.getContexts())) { this.contexts.add(new ContextConfig(context)); } }
/** * This is a copy constructor. It must create a perfect, deep, copy of this object */ public ForeignKey(ForeignKey fk) { super(); this.name = fk.getName(); this.onDelete = fk.getOnDelete(); this.onUpdate = fk.getOnUpdate(); this.localColumnNames = new ArrayList<String>(CollectionUtils.toEmptyList(fk.getLocalColumnNames())); this.foreignColumnNames = new ArrayList<String>(CollectionUtils.toEmptyList(fk.getForeignColumnNames())); this.localTableName = fk.getLocalTableName(); this.foreignTableName = fk.getForeignTableName(); }
@Override public Properties getProperties(List<String> configIds, Properties overrides) { List<org.kuali.common.util.config.ProjectConfig> requests = org.kuali.common.util.config.ConfigUtils.getProjectConfigs(CollectionUtils.toEmptyList(configIds)); return loadProperties(requests, PropertyUtils.toEmpty(overrides)); }
@Deprecated public static PropertySource<?> getGlobalPropertySource(org.kuali.common.util.ProjectContext context, String... locations) { org.kuali.common.util.property.ProjectProperties pp = org.kuali.common.util.ProjectUtils.getProjectProperties(context); PropertiesContext pc = pp.getPropertiesContext(); List<String> existingLocations = CollectionUtils.toEmptyList(pc.getLocations()); if (locations != null) { for (String location : locations) { existingLocations.add(location); } } pc.setLocations(existingLocations); return getGlobalPropertySource(pp); }
public Log4JContext(Log4JContext context) { super(); this.reset = context.getReset(); this.debug = context.getDebug(); this.threshold = context.getThreshold(); this.root = context.getRoot(); for (Appender appender : CollectionUtils.toEmptyList(context.getAppenders())) { this.appenders.add(new Appender(appender)); } for (Logger logger : CollectionUtils.toEmptyList(context.getLoggers())) { this.loggers.add(new Logger(logger)); } }
public Logger(Logger logger) { super(); this.additivity = logger.getAdditivity(); this.name = logger.getName(); this.level = logger.getLevel(); for (AppenderRef reference : CollectionUtils.toEmptyList(logger.getReferences())) { this.references.add(new AppenderRef(reference)); } }
protected boolean isExclude(ObjectListingsContext context, String prefix) { for (String exclude : CollectionUtils.toEmptyList(context.getRequest().getExcludes())) { if (isEndsWithMatch(prefix, exclude, context.getBucketContext().getDelimiter())) { return true; } } return false; }