
no.whirlwin.jsonpatch.PatchOperation Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of json-patch Show documentation
Show all versions of json-patch Show documentation
Java JSON patch implementation
The newest version!
package no.whirlwin.jsonpatch;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
public enum PatchOperation {
REPLACE("replace");
private static final Map stringToPatchOperationsMap = new HashMap<>();
private final String name;
static {
Arrays.asList(PatchOperation.values())
.stream()
.forEach(operation -> stringToPatchOperationsMap.put(operation.name, operation));
}
PatchOperation(final String name) {
this.name = name;
}
public static Optional fromString(final String name) {
return Optional.ofNullable(stringToPatchOperationsMap.get(name));
}
@Override
public String toString() {
return super.toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy