homegear
Class HomeGearResponse

java.lang.Object
  extended by homegear.HomeGearArray
      extended by homegear.HomeGearResponse

public class HomeGearResponse
extends HomeGearArray

Represantation of response from the homegear server. Its a HomeGearArray with additional information about kind of response. If the response is an array or a struct this variable is stored directly, otherwise a array consisting in one variable is generated. The response has to be created using the createResponse(boolean,byte[]) method.


Field Summary
 
Fields inherited from class homegear.HomeGearArray
data, length, offs, TYPE_ARRAY, TYPE_BASE64, TYPE_BOOL, TYPE_FLOAT, TYPE_INT, TYPE_STRING, TYPE_STRUCT
 
Method Summary
static HomeGearResponse createResponse(boolean isError_, byte[] buf)
          Constructs an error response from raw data.
 boolean isError()
          Return true if it is an error response.
 
Methods inherited from class homegear.HomeGearArray
boolValue, child, compress, copy, doubleValue, find, intEncode, intValue, isStruct, main, name, size, stringValue, toString, toString, type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

createResponse

public static HomeGearResponse createResponse(boolean isError_,
                                              byte[] buf)
                                       throws java.lang.IllegalArgumentException
Constructs an error response from raw data.

Parameters:
isError_ - true if it is an error response.
buf - Buffer containing raw response data.
Throws:
java.lang.IllegalArgumentException - if a parameter is invalid.

isError

public boolean isError()
Return true if it is an error response.

Returns:
true if it is an error response.