![JAR search and dependency download from the Maven repository](/logo.png)
com.twilio.sdk.updater.Updater Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of twilio-java-sdk Show documentation
Show all versions of twilio-java-sdk Show documentation
Java helper library for Twilio services
The newest version!
package com.twilio.sdk.updater;
import com.google.common.util.concurrent.ListenableFuture;
import com.twilio.sdk.Twilio;
import com.twilio.sdk.client.TwilioRestClient;
import com.twilio.sdk.resource.Resource;
import java.util.concurrent.Callable;
/**
* Executor for updates of a resource.
*
* @param type of the resource
*/
public abstract class Updater {
/**
* Execute an async request using default client.
*
* @return future that resolves to requested object
*/
public ListenableFuture async() {
return async(Twilio.getRestClient());
}
/**
* Execute an async request using specified client.
*
* @param client client used to make request
* @return future that resolves to requested object
*/
public ListenableFuture async(final TwilioRestClient client) {
return Twilio.getExecutorService().submit(new Callable() {
public T call() {
return execute(client);
}
});
}
/**
* Execute a request using default client.
*
* @return Requested object
*/
public T execute() {
return execute(Twilio.getRestClient());
}
/**
* Execute a request using specified client.
*
* @param client client used to make request
* @return Requested object
*/
public abstract T execute(final TwilioRestClient client);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy