
com.twilio.base.Deleter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of twilio Show documentation
Show all versions of twilio Show documentation
Twilio Java Helper Library
package com.twilio.base;
import com.google.common.util.concurrent.ListenableFuture;
import com.twilio.Twilio;
import com.twilio.http.TwilioRestClient;
import java.util.concurrent.Callable;
/**
* Executor for deletes of a resource.
*
* @param type of the resource
*/
public abstract class Deleter {
/**
* Execute an async request using default client.
*
* @return future that resolves to true if the object was deleted
*/
public ListenableFuture deleteAsync() {
return deleteAsync(Twilio.getRestClient());
}
/**
* Execute an async request using specified client.
*
* @param client client used to make request
* @return future that resolves to true if the object was deleted
*/
public ListenableFuture deleteAsync(final TwilioRestClient client) {
return Twilio.getExecutorService().submit(new Callable() {
public Boolean call() {
return delete(client);
}
});
}
/**
* Execute a request using default client.
*
* @return true if the object was deleted
*/
public boolean delete() {
return delete(Twilio.getRestClient());
}
/**
* Execute a request using specified client.
*
* @param client client used to make request
* @return true if the object was deleted
*/
public abstract boolean delete(final TwilioRestClient client);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy