public final class RQLResult
extends java.lang.Object
implements java.io.Serializable
RQLRequest that was sent to the RoboServer, as well as all received
RQLResponses.
The RQLResult object is a convenient way to access a number
of other details. Some aspects of the result will only be applicable for
specific requests:
ExecuteRequests,
or indirectly from invoking one of the RobotExecutor.request methods. The most
important point of a robot execution if often the objects that are extracted. They can
be accessed by calling the getObjects method. Two other methods
getByName and
getBySignature provide a means of selecting
what kind of objects to get.ServerExecutionEventResponse with an event type of
ExecutionEvent.STOP_REQUESTED. If the robot could not be stopped, no
response is generated. RQLResults are normally returned by calls to the static methods
in RobotExecutor, but it is also possible to create your own, for example
by salvaging part of a result from an RQLException containing
the RQLResult and RQLResponses.
Objects of this class are immutable.
| Constructor and Description |
|---|
RQLResult(RQLRequest request,
java.util.List<RQLResponse> responses)
Creates a new
RQLResult object based on the result of processing an
RQLRequest. |
| Modifier and Type | Method and Description |
|---|---|
java.util.List<ErrorResponse> |
getErrors()
Returns a list of
ErrorResponse objects. |
java.lang.String |
getExecutionId()
Returns the
executionId of the robot,
This will return null if the request that generated this result
was not an ExecuteRequest, or if it did not contain a response
that had an executionId property. |
java.util.List<java.lang.String> |
getMessages()
Returns a list of strings containing the logging messages sent by the robot.
|
java.util.List |
getObjects()
Deprecated.
The
ExtractedObject class has been deprecated
due to terminology changes. Use the getOutputObjects() method
instead. |
java.util.List |
getObjectsByName(java.lang.String modelName)
Deprecated.
The
ExtractedObject class has been deprecated
due to terminology changes. Use the method getOutputObjects()
combined with RQLObjects.getByName(String) instead. |
java.util.List |
getObjectsBySignature(java.util.List attributeNames)
Deprecated.
The
ExtractedObject class has been deprecated
due to terminology changes. Use the method getOutputObjects()
combined with RQLObjects.getBySignature(List) instead. |
RQLObjects |
getOutputObjects()
Returns the output objects as an
RQLObjects list. |
RQLObjects |
getOutputObjectsByName(java.lang.String modelName)
Returns the output objects as an
RQLObjects list. |
RQLObjects |
getOutputObjectsBySignature(java.util.List attributeNames)
Returns the output objects as an
RQLObjects list. |
java.util.List |
getPingResponses()
Returns all
PingResponses in the result. |
RQLRequest |
getRQLRequest()
Returns the
RQLRequest that this result was generated by. |
java.util.List |
getRQLResponses()
Returns the raw
RQLResponses that make up the result. |
java.util.List<RQLResponse> |
getRQLResponsesByClass(java.lang.Class responseType)
Returns a list of
RQLResponses that satisfies the condition:
responseType.isInstance(response). |
java.lang.String |
toString()
Returns a string representation of the object.
|
public RQLResult(RQLRequest request, java.util.List<RQLResponse> responses)
RQLResult object based on the result of processing an
RQLRequest.request - the RQLRequest that generated the resultresponses - a list of RQLResponses that make up the resultjava.lang.NullPointerException - if either parameter is null.java.lang.IllegalArgumentException - if one or more of the elements in responses
are null or not RQLResponses.public java.util.List<ErrorResponse> getErrors()
ErrorResponse objects. These can be either
RobotErrorResponses or ServerErrorResponses.ErrorMessage objects.ErrorResponse,
RobotErrorResponse,
ServerErrorResponsepublic java.util.List<java.lang.String> getMessages()
RobotMessageResponse objects can be accessed
by calling getRQLResponsesByClass(RobotMessageResponse.class).public java.util.List getObjects()
ExtractedObject class has been deprecated
due to terminology changes. Use the getOutputObjects() method
instead.ExtractedObjects returned by the robot.ExtractedObjects returned by the robot.RQLObjectpublic java.util.List getObjectsByName(java.lang.String modelName)
ExtractedObject class has been deprecated
due to terminology changes. Use the method getOutputObjects()
combined with RQLObjects.getByName(String) instead.ExtractedObjects with a specific name.
The objects returned by this method will satisfy the condition:
obj.getName().equals(modelName).
modelName - the required object model nameExtractedObjects with a specific namejava.lang.NullPointerException - if the modelName parameter was
null.public java.util.List getObjectsBySignature(java.util.List attributeNames)
ExtractedObject class has been deprecated
due to terminology changes. Use the method getOutputObjects()
combined with RQLObjects.getBySignature(List) instead.ExtractedObjects that have a specific set of attributes.
The objects returned by this method will satisfy the condition:
obj.getAttributes().keySet().containsAll(attributeNames), and it is
therefore guaranteed that the objects will not throw NoSuchAttributeExceptions
when queried for the given attributes.
attributeNames - a list of Strings containing the required attribute
names.ExtractedObjects with the specified signature.java.lang.NullPointerException - if the attributeNames parameter was
null.public RQLObjects getOutputObjects()
RQLObjects list.RQLObjects list.public RQLObjects getOutputObjectsByName(java.lang.String modelName)
RQLObjects list.
The objects returned by this method will satisfy the condition:
obj.getName().equals(modelName).
modelName - the required object model nameExtractedObjects with a specific namejava.lang.NullPointerException - if the modelName parameter was
null.public RQLObjects getOutputObjectsBySignature(java.util.List attributeNames)
RQLObjects list.
The objects returned by this method will satisfy the condition:
obj.getAttributes().keySet().containsAll(attributeNames), and it is
therefore guaranteed that the objects will not throw NoSuchAttributeExceptions
when queried for the given attributes.
attributeNames - a list of Strings containing the required attribute
names.ExtractedObjects with the specified signature.java.lang.NullPointerException - if the attributeNames parameter was
null.public RQLRequest getRQLRequest()
RQLRequest that this result was generated by.RQLRequest that this result was generated by.public java.util.List getRQLResponses()
RQLResponses that make up the result.RQLResponses that make up the result.RQLResponsepublic java.util.List<RQLResponse> getRQLResponsesByClass(java.lang.Class responseType)
RQLResponses that satisfies the condition:
responseType.isInstance(response).responseType - the type of response to check for. Can be a super-class,
which results in all instances of subclasses being returned.RQLResponses that make up the result.java.lang.NullPointerException - if the responseType parameter was
null.RQLResponsepublic java.util.List getPingResponses()
PingResponses in the result.
The effect is identical to invoking
getRQLResponsesByClass(PingResponse.class).PingResponses in the result.PingResponsepublic java.lang.String getExecutionId()
executionId of the robot,
This will return null if the request that generated this result
was not an ExecuteRequest, or if it did not contain a response
that had an executionId property.executionId of the robot, or null if the
request was not an ExecuteRequest or the robot could not be
assigned an id.ServerExecutionEventResponse,
RobotResponsepublic java.lang.String toString()
toString in class java.lang.ObjectRoboSuite Java API, v9.7.7763