/** * Returns an instance of {@code UnblockNamespaceResponse}. * * @param namespace the namespace the returned response relates to. * @param resourceType type of the {@code Resource} represented by the returned response. * @param dittoHeaders the headers of the command which caused the returned response. * @return the instance. * @throws NullPointerException if any argument is {@code null}. * @throws IllegalArgumentException if {@code namespace} or {@code resourceType} is empty. */ public static UnblockNamespaceResponse getInstance(final CharSequence namespace, final CharSequence resourceType, final DittoHeaders dittoHeaders) { return new UnblockNamespaceResponse(namespace, resourceType, dittoHeaders); }
@Override public UnblockNamespaceResponse setDittoHeaders(final DittoHeaders dittoHeaders) { return new UnblockNamespaceResponse(getNamespace(), getResourceType(), dittoHeaders); }
/** * Creates a new {@code UnblockNamespaceResponse} from the given JSON object. * * @param jsonObject the JSON object of which the UnblockNamespaceResponse is to be created. * @param headers the headers. * @return the deserialized response. * @throws NullPointerException if any argument is {@code null}. * @throws org.eclipse.ditto.json.JsonParseException if {@code jsonObject} was not in the expected format. * @throws org.eclipse.ditto.json.JsonMissingFieldException if {@code jsonObject} did not contain * <ul> * <li>{@link NamespaceCommandResponse.JsonFields#NAMESPACE} or</li> * <li>{@link NamespaceCommandResponse.JsonFields#RESOURCE_TYPE}.</li> * </ul> */ public static UnblockNamespaceResponse fromJson(final JsonObject jsonObject, final DittoHeaders headers) { return new CommandResponseJsonDeserializer<UnblockNamespaceResponse>(TYPE, jsonObject).deserialize( statusCode -> { final String namespace = jsonObject.getValueOrThrow(NamespaceCommandResponse.JsonFields.NAMESPACE); final String resourceType = jsonObject.getValueOrThrow(NamespaceCommandResponse.JsonFields.RESOURCE_TYPE); return new UnblockNamespaceResponse(namespace, resourceType, headers); }); }