Example usage for java.lang UnsupportedOperationException UnsupportedOperationException

List of usage examples for java.lang UnsupportedOperationException UnsupportedOperationException

Introduction

In this page you can find the example usage for java.lang UnsupportedOperationException UnsupportedOperationException.

Prototype

public UnsupportedOperationException(Throwable cause) 

Source Link

Document

Constructs a new exception with the specified cause and a detail message of (cause==null ?

Usage

From source file:Main.java

/**
 * Execute an {@link AsyncTask} on a thread pool
 * /*from  w  ww .  j a  v a  2  s. c o  m*/
 * @param forceSerial True to force the task to run in serial order
 * @param task Task to execute
 * @param args Optional arguments to pass to
 *            {@link AsyncTask#execute(Object[])}
 * @param <T> Task argument type
 */
@SuppressLint("NewApi")
public static <T> void execute(final boolean forceSerial, final AsyncTask<T, ?, ?> task, final T... args) {
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.DONUT) {
        throw new UnsupportedOperationException("This class can only be used on API 4 and newer.");
    }
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB || forceSerial) {
        task.execute(args);
    } else {
        task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, args);
    }
}

From source file:net.beachchou.spring.ioc.aware.BeanNameAwareBean.java

@Override
public void setBeanName(String string) {
    throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}

From source file:Main.java

/**
 * Execute an {@link AsyncTask} on a thread pool
 * /*from w w w.ja va  2 s.c o  m*/
 * @param forceSerial True to force the task to run in serial order
 * @param task Task to execute
 * @param args Optional arguments to pass to
 *            {@link AsyncTask#execute(Object[])}
 * @param <T> Task argument type
 */
@SuppressLint("NewApi")
public static <T> void execute(final boolean forceSerial, final AsyncTask<T, ?, ?> task, final T... args) {
    final WeakReference<AsyncTask<T, ?, ?>> taskReference = new WeakReference<AsyncTask<T, ?, ?>>(task);
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.DONUT) {
        throw new UnsupportedOperationException("This class can only be used on API 4 and newer.");
    }
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB || forceSerial) {
        taskReference.get().execute(args);
    } else {
        taskReference.get().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, args);
    }
}

From source file:com.sshdemo.common.schedule.generate.quartz.NullTaskExecutor.java

@Override
public void execute(Runnable task) {
    throw new UnsupportedOperationException("This class can only be used as a placeholder for null");
}

From source file:net.beachchou.spring.ioc.aware.BeanClassLoaderAwareBean.java

@Override
public void setBeanClassLoader(ClassLoader cl) {
    throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}

From source file:com.oak_yoga_studio.validators.FormValidator.java

@Override
public boolean supports(Class<?> type) {
    throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}

From source file:com.gisnet.cancelacion.persistance.services.Query.java

public static <T extends Info> T saveOrUpdate(T info, CrudRepository repo) {
    throw new UnsupportedOperationException("not supported yet");
}

From source file:net.kazyx.wirespider.TestUtil.java

public static ByteBuffer asByteBuffer(String data) {
    try {//  w w w.j ava  2s  .  c o m
        return ByteBuffer.wrap(data.getBytes("UTF-8"));
    } catch (UnsupportedEncodingException e) {
        throw new UnsupportedOperationException(e);
    }
}

From source file:Main.java

/**
 * Put an arbitrary object into a {@link ContentValues}
 *
 * @param target the ContentValues store
 * @param key the key to use/*from   w  w  w  .  j  a va  2  s .  c  o m*/
 * @param value the value to store
 */
public static void putInto(ContentValues target, String key, Object value, boolean errorOnFail) {
    if (value == null) {
        target.putNull(key);
    } else if (value instanceof Boolean) {
        target.put(key, (Boolean) value);
    } else if (value instanceof Byte) {
        target.put(key, (Byte) value);
    } else if (value instanceof Double) {
        target.put(key, (Double) value);
    } else if (value instanceof Float) {
        target.put(key, (Float) value);
    } else if (value instanceof Integer) {
        target.put(key, (Integer) value);
    } else if (value instanceof Long) {
        target.put(key, (Long) value);
    } else if (value instanceof Short) {
        target.put(key, (Short) value);
    } else if (value instanceof String) {
        target.put(key, (String) value);
    } else if (value instanceof byte[]) {
        target.put(key, (byte[]) value);
    } else if (errorOnFail) {
        throw new UnsupportedOperationException("Could not handle type " + value.getClass());
    }
}

From source file:com.netflix.hystrix.serial.SerialHystrixUtilization.java

@Deprecated
public static byte[] toBytes(HystrixUtilization utilization) {
    throw new UnsupportedOperationException(
            "Not implemented anymore.  Will be implemented in a new class shortly");
}