/** * Generates an instance of the Status class based on the passed StatusCode * only. The description field of the Status object will be inferred by the * status code. * * @param errorCode * The status code. If passed as null, code will be stored as * {@code StatusCode.UNDEFINED} */ public Status(StatusCode errorCode) { this.code = (errorCode != null) ? errorCode : StatusCode.UNDEFINED; this.description = (description != null) ? description : this.code .toString(); this.requestId = 0; }
/** * Generates an instance of the Status class. This is used as return code * for internal API2 function calls. This constructor allows to specify, * beside the Status Code, a custom human readable description to add more * information about the status. * * @param errorCode * The status code. If passed as null, code will be stored as * {@code StatusCode.UNDEFINED} * @param description * The human readable description of the status. If passed as * null, description will be inferred by the code */ public Status(StatusCode errorCode, String description) { this.code = (errorCode != null) ? errorCode : StatusCode.UNDEFINED; this.description = (description != null) ? description : this.code .toString(); this.requestId = 0; }
/** * Generates an instance of the Status class to be used in case of * asynchronous call. It is supposed to be created by the underlying * infrastructure only when it was successful in allocating the asynchronous * request id, hence caller should expect StatusCode to be successful. * * @param errorCode * The status code. If passed as null, code will be stored as * {@code StatusCode.UNDEFINED} * @param requestId * The request id set by underlying infrastructure for this * request */ public Status(StatusCode errorCode, long requestId) { this.code = (errorCode != null) ? errorCode : StatusCode.UNDEFINED; this.description = (description != null) ? description : this.code .toString(); this.requestId = requestId; }