org.asteriskjava.pbx.asterisk.wrap.response.CommandResponse Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of asterisk-java Show documentation
Show all versions of asterisk-java Show documentation
The free Java library for Asterisk PBX integration.
package org.asteriskjava.pbx.asterisk.wrap.response;
import java.util.Collections;
import java.util.List;
public class CommandResponse extends ManagerResponse
{
private List result;
private boolean error;
public CommandResponse(org.asteriskjava.manager.response.ManagerResponse response)
{
super(response);
if (response instanceof org.asteriskjava.manager.response.CommandResponse) {
result = ((org.asteriskjava.manager.response.CommandResponse) response).getResult();
} else if (response instanceof org.asteriskjava.manager.response.ManagerError) {
error = true;
result = Collections.singletonList(response.getOutput());
}
}
public List getResult()
{
return this.result;
}
public boolean isError()
{
return error;
}
}