datai/docs/reference-code/force-wsc-57.0.0/com/sforce/async/BatchResult.java

76 lines
2.5 KiB
Java

package com.sforce.async;
import com.sforce.ws.ConnectionException;
import com.sforce.ws.bind.TypeInfo;
import com.sforce.ws.bind.TypeMapper;
import com.sforce.ws.bind.XMLizable;
import com.sforce.ws.parser.XmlInputStream;
import com.sforce.ws.parser.XmlOutputStream;
import com.sforce.ws.util.Verbose;
import java.io.IOException;
import javax.xml.namespace.QName;
public class BatchResult implements XMLizable {
private boolean partialResult = false;
public boolean isPartialResult() {
return this.partialResult;
}
private static final TypeInfo result__typeInfo = new TypeInfo("http://www.force.com/2009/06/asyncapi/dataload", "result", "http://www.force.com/2009/06/asyncapi/dataload", "SaveResult", 0, -1, true);
private boolean result__is_set;
private Result[] result;
public BatchResult() {
this.result__is_set = false;
this.result = new Result[0];
}
public Result[] getResult() {
return this.result;
}
public void setResult(Result[] result) {
this.result = result;
this.result__is_set = true;
}
public void write(QName __element, XmlOutputStream __out, TypeMapper __typeMapper) throws IOException {
__out.writeStartTag(__element.getNamespaceURI(), __element.getLocalPart());
writeFields(__out, __typeMapper);
__out.writeEndTag(__element.getNamespaceURI(), __element.getLocalPart());
}
protected void writeFields(XmlOutputStream __out, TypeMapper __typeMapper) throws IOException {
__typeMapper.writeObject(__out, result__typeInfo, this.result, this.result__is_set);
}
public void load(XmlInputStream __in, TypeMapper __typeMapper) throws IOException, ConnectionException {
try {
__typeMapper.consumeStartTag(__in);
loadFields(__in, __typeMapper);
__typeMapper.consumeEndTag(__in);
} catch (com.sforce.ws.bind.TypeMapper.PartialArrayException e) {
this.partialResult = true;
setResult((Result[])e.getArrayResult());
}
}
protected void loadFields(XmlInputStream __in, TypeMapper __typeMapper) throws IOException, ConnectionException {
__in.peekTag();
if (__typeMapper.isElement(__in, result__typeInfo))
setResult((Result[])__typeMapper.readPartialArray(__in, result__typeInfo, Result[].class));
}
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("[BatchResult ");
sb.append(" result=");
sb.append("'").append(Verbose.toString(this.result)).append("'\n");
sb.append("]\n");
return sb.toString();
}
}