Java Thread Callable resolveSingle(Object object)

Here you can find the source of resolveSingle(Object object)

Description

resolve Single

License

LGPL

Declaration

public static Object resolveSingle(Object object) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

import java.util.concurrent.Callable;

public class Main {
    public static Object resolveSingle(Object object) {
        try {//from  ww  w  .  ja  va 2 s .  c o  m
            return object instanceof Callable ? ((Callable<?>) object).call() : object;
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}

Related

  1. max(final double[] a, final double[] b)
  2. minScalar(final double[] a, final double scalar)
  3. powerTo(final double base, final double[] exponents)
  4. repeatedlyTry(Callable task, int maxRounds, long backoff)
  5. resolveCompositeKey(final String key, final Map props)
  6. runAndRethrowRuntimeExceptionOnFailure(final Callable operation, final String exceptionMessage)
  7. runConcurrently(final Callable task)
  8. runConcurrently(final Callable task)
  9. runConcurrently(final Callable task, final int times)