Files
2026-11-21 17:07:18 -05:00

101 lines
2.4 KiB
Java

/* */ package kong.unirest.cosmetics;
/* */
/* */ import java.util.Optional;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ class HttpRequestJsonPatch
/* */ extends BaseRequest<JsonPatchRequest>
/* */ implements JsonPatchRequest
/* */ {
/* 32 */ private JsonPatch items = new JsonPatch();
/* */
/* */ HttpRequestJsonPatch(Config config, String url) {
/* 35 */ super(config, HttpMethod.PATCH, url);
/* 36 */ header("Content-Type", "application/json-patch+json");
/* */ }
/* */
/* */
/* */ public JsonPatchRequest add(String path, Object value) {
/* 41 */ this.items.add(path, value);
/* 42 */ return this;
/* */ }
/* */
/* */
/* */ public JsonPatchRequest remove(String path) {
/* 47 */ this.items.remove(path);
/* 48 */ return this;
/* */ }
/* */
/* */
/* */ public JsonPatchRequest replace(String path, Object value) {
/* 53 */ this.items.replace(path, value);
/* 54 */ return this;
/* */ }
/* */
/* */
/* */ public JsonPatchRequest test(String path, Object value) {
/* 59 */ this.items.test(path, value);
/* 60 */ return this;
/* */ }
/* */
/* */
/* */ public JsonPatchRequest move(String from, String path) {
/* 65 */ this.items.move(from, path);
/* 66 */ return this;
/* */ }
/* */
/* */
/* */ public JsonPatchRequest copy(String from, String path) {
/* 71 */ this.items.copy(from, path);
/* 72 */ return this;
/* */ }
/* */
/* */
/* */ public Optional<Body> getBody() {
/* 77 */ return Optional.of(this);
/* */ }
/* */
/* */
/* */ public BodyPart uniPart() {
/* 82 */ String bodyAsString = this.items.toString();
/* 83 */ return new UnibodyString(bodyAsString);
/* */ }
/* */
/* */
/* */ public boolean isMultiPart() {
/* 88 */ return false;
/* */ }
/* */
/* */
/* */ public boolean isEntityBody() {
/* 93 */ return true;
/* */ }
/* */ }
/* Location: C:\Users\Xiao\Downloads\MinehutCosmetics.jar!\kon\\unirest\cosmetics\HttpRequestJsonPatch.class
* Java compiler version: 11 (55.0)
* JD-Core Version: 1.1.3
*/