/** * Creates a response to a {@link RetrieveFeatureDefinition} command from a JSON string. * * @param jsonString the JSON string of which the response is to be created. * @param dittoHeaders the headers of the preceding command. * @return the response. * @throws NullPointerException if {@code jsonString} is {@code null}. * @throws IllegalArgumentException if {@code jsonString} is empty. * @throws org.eclipse.ditto.json.JsonParseException if the passed in {@code jsonString} was not in the expected * format. * @throws org.eclipse.ditto.json.JsonMissingFieldException if the parsed {@code jsonString} did not contain any of * the required fields * <ul> * <li>{@link ThingQueryCommandResponse.JsonFields#JSON_THING_ID},</li> * <li>{@link #JSON_FEATURE_ID} or</li> * <li>{@link #JSON_DEFINITION}.</li> * </ul> * @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 RetrieveFeatureDefinitionResponse fromJson(final String jsonString, final DittoHeaders dittoHeaders) { return fromJson(JsonFactory.newObject(jsonString), dittoHeaders); }
/** * Creates a response to a {@link RetrieveFeatureDefinition} command from a JSON string. * * @param jsonString the JSON string of which the response is to be created. * @param dittoHeaders the headers of the preceding command. * @return the response. * @throws NullPointerException if {@code jsonString} is {@code null}. * @throws IllegalArgumentException if {@code jsonString} is empty. * @throws org.eclipse.ditto.json.JsonParseException if the passed in {@code jsonString} was not in the expected * format. * @throws org.eclipse.ditto.json.JsonMissingFieldException if the parsed {@code jsonString} did not contain any of * the required fields * <ul> * <li>{@link ThingQueryCommandResponse.JsonFields#JSON_THING_ID},</li> * <li>{@link #JSON_FEATURE_ID} or</li> * <li>{@link #JSON_DEFINITION}.</li> * </ul> * @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 RetrieveFeatureDefinitionResponse fromJson(final String jsonString, final DittoHeaders dittoHeaders) { return fromJson(JsonFactory.newObject(jsonString), dittoHeaders); }