Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[leshan-dev] [Bug 480205] New: Introduction of ObserveResponse breaks ResponseSerializer

https://bugs.eclipse.org/bugs/show_bug.cgi?id=480205
Product/Component: Leshan / General

            Bug ID: 480205
           Summary: Introduction of ObserveResponse breaks
                    ResponseSerializer
    Classification: IoT
           Product: Leshan
           Version: unspecified
          Hardware: PC
                OS: Windows 7
            Status: NEW
          Severity: normal
          Priority: P3
         Component: General
          Assignee: leshan-inbox@xxxxxxxxxxx
          Reporter: achim.kraus@xxxxxxxxxxxx

Introducing the ObserveResponse breaks the ResponseSerializer which checks for
ValueResponse.

<code>
public class ResponseSerializer implements JsonSerializer<LwM2mResponse> {

    @Override
    public JsonElement serialize(final LwM2mResponse src, final Type typeOfSrc,
final JsonSerializationContext context) {
        final JsonObject element = new JsonObject();

        element.addProperty("status", src.getCode().toString());

        if (typeOfSrc == ValueResponse.class) {
            element.add("content", context.serialize(((ValueResponse)
src).getContent()));
        }

        return element;
    }
}
</code>

-- 
You are receiving this mail because:
You are watching the assignee of the bug.


Back to the top