public class StateSelectorByRequestPath
extends java.lang.Object
Select a Variant state based on a path pattern. Implements a sophisticated path matching scheme:
Examples:
Path | Will Match | Will Not Match |
---|---|---|
/user | /user /user/ |
/user/new |
/user// | /user /user/ /user/new |
/service/user/ |
/user//.html | /user/new/error.html | /user/error |
Constructor and Description |
---|
StateSelectorByRequestPath() |
Modifier and Type | Method and Description |
---|---|
static boolean |
match(java.lang.String pattern,
java.lang.String string)
This implements the whole path matching logic.
|
static java.util.Optional<com.variant.core.schema.State> |
select(com.variant.core.schema.Schema schema,
java.lang.String resourcePath)
Select a Variant state by its path.
|
public static boolean match(java.lang.String pattern, java.lang.String string)
public static java.util.Optional<com.variant.core.schema.State> select(com.variant.core.schema.Schema schema, java.lang.String resourcePath)
resourcePath
- the resource path to match against.Release 0.10.1. Updated 04 Sep 2019.
Copyright © 2019 Variant Inc.