sk.seges.sesam.utils.CastUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sesam-core Show documentation
Show all versions of sesam-core Show documentation
Core interfaces and support classes to ease
information systems development. Usually requirement is to implement
multi-tier application using database, DAOs, services, models and
listeners.
The newest version!
package sk.seges.sesam.utils;
import java.util.Collection;
import java.util.List;
import java.util.Set;
public final class CastUtils {
@SuppressWarnings("unchecked")
public static List cast(List> list, Class type) {
return (List) list;
}
@SuppressWarnings("unchecked")
public static Collection cast(Collection> list, Class type) {
return (Collection) list;
}
@SuppressWarnings("unchecked")
public static S cast(Object object, Class type) {
return (S) object;
}
@SuppressWarnings("unchecked")
public static Set cast(Set> set, Class type) {
return (Set) set;
}
}