Search in sources :

Example 1 with ShadowStateFactory

use of software.amazon.awssdk.iot.ShadowStateFactory in project aws-iot-device-sdk-java-v2 by aws.

the class IotShadowClient method addTypeAdapters.

private void addTypeAdapters(GsonBuilder gson) {
    ShadowStateFactory shadowStateFactory = new ShadowStateFactory();
    gson.registerTypeAdapterFactory(shadowStateFactory);
}
Also used : ShadowStateFactory(software.amazon.awssdk.iot.ShadowStateFactory)

Example 2 with ShadowStateFactory

use of software.amazon.awssdk.iot.ShadowStateFactory in project aws-iot-device-sdk-java-v2 by aws.

the class ShadowStateTest method TestSetup.

@BeforeEach
public void TestSetup() {
    if (shadowGson == null) {
        GsonBuilder gsonBuilder = new GsonBuilder();
        gsonBuilder.disableHtmlEscaping();
        gsonBuilder.registerTypeAdapter(Timestamp.class, new Timestamp.Serializer());
        gsonBuilder.registerTypeAdapter(Timestamp.class, new Timestamp.Deserializer());
        ShadowStateFactory shadowStateFactory = new ShadowStateFactory();
        gsonBuilder.registerTypeAdapterFactory(shadowStateFactory);
        shadowGson = gsonBuilder.create();
    }
}
Also used : GsonBuilder(com.google.gson.GsonBuilder) ShadowStateFactory(software.amazon.awssdk.iot.ShadowStateFactory) Timestamp(software.amazon.awssdk.iot.Timestamp) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

ShadowStateFactory (software.amazon.awssdk.iot.ShadowStateFactory)2 GsonBuilder (com.google.gson.GsonBuilder)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1 Timestamp (software.amazon.awssdk.iot.Timestamp)1