/**
 * Copyright (c) 2017 Bosch Software Innovations GmbH.
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    Bosch Software Innovations GmbH - initial creation
 */
package org.eclipse.hono.util;


/**
 * A container for the result returned by a Hono API that implements the request response pattern.
 *
 * @param <T> denotes the concrete type of the payload that is part of the result
 */
public class RequestResponseResult<T> {

    private final int status;
    private final T payload;

    /**
     * Creates a new result for a status code and payload.
     * 
     * @param status The code indicating the outcome of processing the request.
     * @param payload The payload to convey to the sender of the request.
     */
    protected RequestResponseResult(final int status, final T payload) {
        this.status = status;
        this.payload = payload;
    }

    /**
     * Gets the status code indicating the outcome of the request.
     * 
     * @return The code.
     */
    public final int getStatus() {
        return status;
    }

    /**
     * Gets the payload to convey to the sender of the request.
     * 
     * @return The payload.
     */
    public final T getPayload() {
        return payload;
    }
}

@@ -18,16 +18,22 @@
 (c) 2017
+, 2018
  Bosch S
@@ -420,16 +420,51 @@
 .util;%0A%0A
+import java.net.HttpURLConnection;%0A
 %0A/**%0A * 
@@ -1488,11 +1488,228 @@
 d;%0A    %7D
+%0A%0A    /**%0A     * Checks if this result's status is %3Cem%3EOK%3C/em%3E.%0A     * %0A     * @return %7B@code true%7D if status == 200.%0A     */%0A    public final boolean isOk() %7B%0A        return HttpURLConnection.HTTP_OK == status;%0A    %7D
 %0A%7D%0A

Add convenience method for checking for status code 200 (OK).