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

panda.cast.castor.IterableCastor Maven / Gradle / Ivy

Go to download

Panda Core is the core module of Panda Framework, it contains commonly used utility classes similar to apache-commons.

There is a newer version: 1.8.0
Show newest version
package panda.cast.castor;

import panda.cast.AbstractCastor;
import panda.cast.CastContext;
import panda.lang.Iterators;

@SuppressWarnings("rawtypes")
public class IterableCastor extends AbstractCastor {
	public IterableCastor() {
		super(Object.class, Iterable.class);
	}

	@Override
	protected Iterable castValue(Object value, CastContext context) {
		if (Iterators.isIterable(value)) {
			return Iterators.asIterable(value);
		}
		
		return castError(value, context);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy