SudoRetrieveThing extends AbstractCommand<SudoRetrieveThing> implements SudoCommand<SudoRetrieveThing> { public static SudoRetrieveThing withOriginalSchemaVersion(final ThingId thingId, @Nullable final JsonFieldSelector selectedFields, final DittoHeaders dittoHeaders) { return new SudoRetrieveThing(thingId, selectedFields, dittoHeaders, true); } private  SudoRetrieveThing(final ThingId thingId,
            @Nullable final JsonFieldSelector selectedFields,
            final DittoHeaders dittoHeaders,
            final boolean useOriginalSchemaVersion); static SudoRetrieveThing of(final ThingId thingId, final DittoHeaders dittoHeaders); static SudoRetrieveThing of(final ThingId thingId, @Nullable final JsonFieldSelector selectedFields,
            final DittoHeaders dittoHeaders); static SudoRetrieveThing withOriginalSchemaVersion(final ThingId thingId,
            @Nullable final JsonFieldSelector selectedFields, final DittoHeaders dittoHeaders); static SudoRetrieveThing withOriginalSchemaVersion(final ThingId thingId,
            final DittoHeaders dittoHeaders); static SudoRetrieveThing fromJson(final String jsonString, final DittoHeaders dittoHeaders); static SudoRetrieveThing fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); @Override String getId(); @Override EntityId getEntityId(); boolean useOriginalSchemaVersion(); Optional<JsonFieldSelector> getSelectedFields(); @Override Category getCategory(); @Override SudoRetrieveThing setDittoHeaders(final DittoHeaders dittoHeaders); @Override boolean equals(@Nullable final Object o); @Override int hashCode(); @Override String toString(); static final String NAME; static final String TYPE; }
@Test public void toJsonWithUsingOriginalSchemaVersionReturnsExpected() { final SudoRetrieveThing sudoRetrieveThing = SudoRetrieveThing.withOriginalSchemaVersion(THING_ID, EMPTY_DITTO_HEADERS); final JsonObject jsonObject = sudoRetrieveThing.toJson(JsonSchemaVersion.V_2, FieldType.regularOrSpecial()); assertThat(jsonObject).contains(SudoRetrieveThing.JSON_USE_ORIGINAL_SCHEMA_VERSION, JsonFactory.newValue(true)); }