All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.codearte.accurest.util.JsonPaths.groovy Maven / Gradle / Ivy

package io.codearte.accurest.util

class JsonPaths extends HashSet {

	Object getAt(String key) {
		return find {
			it.jsonPath == key
		}?.value
	}

	Object putAt(String key, Object value) {
		JsonPathEntry entry = find {
			it.jsonPath == key
		}
		if (!entry) {
			return null
		}
		Object oldValue = entry.value
		add(new JsonPathEntry(entry.jsonPath, entry.optionalSuffix, value))
		return oldValue
	}
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy