@Override public JsonPointer asPointer() { return JsonFactory.newPointer(this); }
@Override public JsonPointer getResourcePath() { return JsonFactory.newPointer("/features/" + featureId); }
@Override public JsonPointer getResourcePath() { return JsonFactory.newPointer("/features/" + featureId + "/definition"); }
private void addPointerString(@Nullable final CharSequence pointerString) { if (null != pointerString) { pointers.add(JsonFactory.newPointer(pointerString)); } }
private void addPointerString(@Nullable final CharSequence pointerString) { if (null != pointerString) { pointers.add(JsonFactory.newPointer(pointerString)); } }
@Override public JsonObject remove(final CharSequence key) { requireNonNull(key, "The key or pointer of the field to be removed must not be null!"); return removeForPointer(JsonFactory.newPointer(key)); }
@Override public JsonFieldSelectorBuilder removePointerString(@Nullable final String pointerString) { if (null == pointerString) { return this; } return removePointer(JsonFactory.newPointer(pointerString)); }
@Override public Optional<JsonValue> getValue(final CharSequence key) { requireNonNull(key, "The key or pointer of the value to be retrieved must not be null!"); return getValueForPointer(JsonFactory.newPointer(key)); }
@Override public SearchQueryBuilder removeSortOptionFor(final CharSequence propertyPath) { checkNotNull(propertyPath, "path of the property to remove the sort option for"); sortOptionEntries.remove(JsonFactory.newPointer(propertyPath)); return this; }
@Override public ImmutableJsonObjectBuilder remove(final CharSequence key) { return remove(JsonFactory.newPointer(key)); }
@Override public JsonFieldSelectorBuilder removePointerString(@Nullable final String pointerString) { if (null == pointerString) { return this; } return removePointer(JsonFactory.newPointer(pointerString)); }
@Override public JsonPointer getResourcePath() { return JsonFactory.newPointer("/acl/" + authorizationSubject.getId()); }
private static Set<JsonPointer> flattenToJsonPointers(final Iterable<String> rawJsonKeys) { final Set<JsonPointer> result = new LinkedHashSet<>(); for (final String rawJsonKey : rawJsonKeys) { if (isJsonSelectorFormat(rawJsonKey)) { result.addAll(flattenToJsonPointers(rawJsonKey)); } else { // slashes are already treated by the constructor of the JSON pointer result.add(JsonFactory.newPointer(rawJsonKey)); } } return result; }
private static Set<JsonPointer> flattenToJsonPointers(final Iterable<String> rawJsonKeys) { final Set<JsonPointer> result = new LinkedHashSet<>(); for (final String rawJsonKey : rawJsonKeys) { if (isJsonSelectorFormat(rawJsonKey)) { result.addAll(flattenToJsonPointers(rawJsonKey)); } else { // slashes are already treated by the constructor of the JSON pointer result.add(JsonFactory.newPointer(rawJsonKey)); } } return result; }
private ImmutablePropertyFilter(final Type type, final CharSequence propertyPath, final Collection<JsonValue> values) { this.type = checkNotNull(type, "type"); this.propertyPath = JsonFactory.newPointer(checkNotNull(propertyPath, "propertyPath")); this.values = Collections.unmodifiableList(new ArrayList<>(values)); }
@Override public JsonPointer getResourcePath() { final AuthorizationSubject authorizationSubject = modifiedAclEntry.getAuthorizationSubject(); return JsonFactory.newPointer("/acl/" + authorizationSubject.getId()); }
private static Collection<ResourcePermissions> createEntriesForFeature(final Feature feature, final Enforcer policyEnforcer) { final Collection<ResourcePermissions> result = new HashSet<>(); result.add(FeatureResourcePermissions.getInstance(feature, policyEnforcer)); final FeatureProperties featureProperties = feature.getProperties().orElseGet( ThingsModelFactory::emptyFeatureProperties); featureProperties.forEach(featureProperty -> result.addAll( createEntriesForFeatureProperty(feature.getId(), JsonFactory.newPointer(featureProperty.getKey()), featureProperty.getValue(), policyEnforcer))); return result; }
/** * Converts a {@link ResourceKey} to an iterator of JSON keys by prepending the resource type to the resource path. * * @param resourceKey The resource key to convert. * @return The converted JSON key iterator. * @throws NullPointerException if {@code resourceKey} is {@code null}. */ static Iterator<JsonKey> getJsonKeyIterator(final ResourceKey resourceKey) { checkNotNull(resourceKey, "resource key to convert"); return JsonFactory.newPointer(resourceKey.getResourceType()).append(resourceKey.getResourcePath()).iterator(); }
public ThingQueryCommandResponseAssert withResourcePath(final CharSequence resourcePath, final JsonPointer furtherResourcePathSegments) { isNotNull(); final JsonPointer expectedResourcePath = JsonFactory.newPointer(resourcePath) .append(furtherResourcePathSegments); final JsonPointer actualResourcePath = actual.getResourcePath(); Assertions.assertThat((Object) actualResourcePath) .overridingErrorMessage("Expected ThingQueryCommandResponse to have resource path \n<%s> but it" + " had\n<%s>", expectedResourcePath, actualResourcePath) .isEqualTo(expectedResourcePath); return myself; }
public ThingModifyCommandResponseAssert withResourcePath(final CharSequence resourcePath, final JsonPointer furtherResourcePathSegments) { isNotNull(); final JsonPointer expectedResourcePath = JsonFactory.newPointer(resourcePath) .append(furtherResourcePathSegments); final JsonPointer actualResourcePath = actual.getResourcePath(); Assertions.assertThat((Object) actualResourcePath) .overridingErrorMessage("Expected ThingModifyCommandResponse to have resource path \n<%s> but it" + " had\n<%s>", expectedResourcePath, actualResourcePath) .isEqualTo(expectedResourcePath); return myself; }