All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.lumongo.util.LumongoUtil Maven / Gradle / Ivy

There is a newer version: 0.52
Show newest version
package org.lumongo.util;

import java.util.Collection;
import java.util.function.Consumer;

public class LumongoUtil {

	public static void handleLists(Object o, Consumer action) {
		if (o instanceof Collection) {
			Collection c = (Collection) o;
			c.stream().forEach(action);
		}
		else if (o instanceof Object[]) {
			Object[] arr = (Object[]) o;
			for (Object obj : arr) {
				action.accept(action);
			}
		}
		else {
			action.accept(o);
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy