@Override public RetrieveAttribute setDittoHeaders(final DittoHeaders dittoHeaders) { return of(thingId, attributePointer, dittoHeaders); }
@Override public RetrieveAttribute setDittoHeaders(final DittoHeaders dittoHeaders) { return of(thingId, attributePointer, dittoHeaders); }
@Override public RetrieveAttributeLiveCommand setDittoHeaders(final DittoHeaders dittoHeaders) { return of(RetrieveAttribute.of(getThingId(), getAttributePointer(), dittoHeaders)); }
@Override public RetrieveAttributeLiveCommand setDittoHeaders(final DittoHeaders dittoHeaders) { return of(RetrieveAttribute.of(getThingId(), getAttributePointer(), dittoHeaders)); }
/** * Creates a new {@code RetrieveAttribute} from a JSON object. * * @param jsonObject the JSON object of which the command is to be created. * @param dittoHeaders the headers of the command. * @return the command. * @throws NullPointerException if any argument is {@code null}. * @throws org.eclipse.ditto.json.JsonParseException if the passed in {@code jsonObject} was not in the expected * format. * @throws org.eclipse.ditto.model.things.ThingIdInvalidException if the parsed thing ID did not comply to {@link * org.eclipse.ditto.model.things.Thing#ID_REGEX}. */ public static RetrieveAttribute fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders) { return new CommandJsonDeserializer<RetrieveAttribute>(TYPE, jsonObject).deserialize(() -> { final String thingId = jsonObject.getValueOrThrow(ThingQueryCommand.JsonFields.JSON_THING_ID); final String extractedPointerString = jsonObject.getValueOrThrow(JSON_ATTRIBUTE); final JsonPointer extractedPointer = JsonFactory.newPointer(extractedPointerString); return of(thingId, extractedPointer, dittoHeaders); }); }
/** * Creates a new {@code RetrieveAttribute} from a JSON object. * * @param jsonObject the JSON object of which the command is to be created. * @param dittoHeaders the headers of the command. * @return the command. * @throws NullPointerException if any argument is {@code null}. * @throws org.eclipse.ditto.json.JsonParseException if the passed in {@code jsonObject} was not in the expected * format. * @throws org.eclipse.ditto.model.things.ThingIdInvalidException if the parsed thing ID did not comply to {@link * org.eclipse.ditto.model.things.Thing#ID_REGEX}. */ public static RetrieveAttribute fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders) { return new CommandJsonDeserializer<RetrieveAttribute>(TYPE, jsonObject).deserialize(() -> { final String thingId = jsonObject.getValueOrThrow(ThingQueryCommand.JsonFields.JSON_THING_ID); final String extractedPointerString = jsonObject.getValueOrThrow(JSON_ATTRIBUTE); final JsonPointer extractedPointer = JsonFactory.newPointer(extractedPointerString); return of(thingId, extractedPointer, dittoHeaders); }); }
selectedFieldsFrom(adaptable), dittoHeadersFrom(adaptable))); mappingStrategies.put(RetrieveAttribute.TYPE, adaptable -> RetrieveAttribute.of(thingIdFrom(adaptable), attributePointerFrom(adaptable), dittoHeadersFrom(adaptable)));
selectedFieldsFrom(adaptable), dittoHeadersFrom(adaptable))); mappingStrategies.put(RetrieveAttribute.TYPE, adaptable -> RetrieveAttribute.of(thingIdFrom(adaptable), attributePointerFrom(adaptable), dittoHeadersFrom(adaptable)));
.of(thingId, JsonFactory.newPointer( decodePath(attributePointerStr)), dittoHeaders))