Interface TypedZPath<T>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Abstraction that allows the construction of ZPaths using strongly typed parameter replacements.
For example, given a path such as "/root/registry/people/{id}" where "id" should be PersonId
.
TypedZPath<PersonId> typedPath = TypedZPath.from("/root/registry/people/{id}");
...
ZPath path = typedPath.resolved(personId);
Additionally, if you have a model/class that implements NodeName
you can pass that when resolving. E.g.
public class MyModel implements NodeName {
...
public String nodeName() {
return modelId;
}
}
TypedZPath<MyModel> typedPath = TypedZPath.from("/foo/bar/{id}");
MyModel model = ...
ZPath path = typedPath.resolved(model);
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TypedZPath
<T> Return a TypedZPath usingZPath.parseWithIds(java.lang.String)
static <T> TypedZPath
<T> Return a TypedZPathResolve into a ZPath using the given parameter
-
Method Details
-
resolved
Resolve into a ZPath using the given parameter- Parameters:
p1
- the parameter- Returns:
- ZPath
-
from
Return a TypedZPath usingZPath.parseWithIds(java.lang.String)
- Parameters:
pathWithIds
- path to pass toZPath.parseWithIds(java.lang.String)
- Returns:
- TypedZPath
-
from
Return a TypedZPath- Parameters:
path
- path to use- Returns:
- TypedZPath
-