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.
@FunctionalInterface public interface TypedZPath<T>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
NodeNameyou 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
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static <T> TypedZPath<T>from(java.lang.String pathWithIds)Return a TypedZPath usingZPath.parseWithIds(java.lang.String)static <T> TypedZPath<T>from(ZPath path)Return a TypedZPathZPathresolved(T p1)Resolve into a ZPath using the given parameter
-
-
-
Method Detail
-
resolved
ZPath resolved(T p1)
Resolve into a ZPath using the given parameter- Parameters:
p1- the parameter- Returns:
- ZPath
-
from
static <T> TypedZPath<T> from(java.lang.String pathWithIds)
Return a TypedZPath usingZPath.parseWithIds(java.lang.String)- Parameters:
pathWithIds- path to pass toZPath.parseWithIds(java.lang.String)- Returns:
- TypedZPath
-
from
static <T> TypedZPath<T> from(ZPath path)
Return a TypedZPath- Parameters:
path- path to use- Returns:
- TypedZPath
-
-