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

com.jn.langx.util.concurrent.WrappedTasks Maven / Gradle / Ivy

Go to download

Java lang extensions for java6+, a supplement to , replacement of a Guava, commons-lang. Core utilities, Collection utilities, IO utilities, Cache, Configuration library ...

There is a newer version: 4.8.2
Show newest version
package com.jn.langx.util.concurrent;

import com.jn.langx.util.Preconditions;

import java.util.concurrent.Callable;

/**
 * @author jinuo.fang
 */
public class WrappedTasks {
    public static WrappedRunnable wrap(Runnable target) {
        Preconditions.checkNotNull(target);
        return ((target instanceof WrappedRunnable) ? (WrappedRunnable) target : new WrappedRunnable(target));
    }

    public static  WrappedCallable wrap(Callable target) {
        Preconditions.checkNotNull(target);
        return ((target instanceof WrappedCallable) ? (WrappedCallable) target : new WrappedCallable(target));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy