Interface PathVariables
-
- All Known Implementing Classes:
DefaultPathVariables
public interface PathVariablesProvides methods to access path variables from an HTTP path.- Since:
- 1.1
-
-
Field Summary
Fields Modifier and Type Field Description static PathVariablesEMPTYDeprecated.please useempty()instead since 2.0
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static PathVariablesempty()Returns the emptyPathVariablesinstances.booleanexists(java.lang.String name)Returns if the path variable by the name given exists.java.util.OptionalDoublegetDouble(java.lang.String name)Returns the path variable asdoubletype by the name given.java.util.OptionalIntgetInt(java.lang.String name)Returns the path variable asinttype by the name given.java.util.OptionalLonggetLong(java.lang.String name)Returns the path variable aslongtype by the name given.java.util.Optional<java.lang.String>getString(java.lang.String name)Returns the path variable by the name given.java.util.Collection<java.lang.String>names()Returns a collection contains of the names of all path variables.intsize()Returns the size of the path variables.
-
-
-
Field Detail
-
EMPTY
@Deprecated static final PathVariables EMPTY
Deprecated.please useempty()instead since 2.0
-
-
Method Detail
-
empty
static PathVariables empty()
Returns the emptyPathVariablesinstances.- Returns:
- the empty
PathVariablesinstances - Since:
- 2.0
-
getString
java.util.Optional<java.lang.String> getString(java.lang.String name)
Returns the path variable by the name given.- Parameters:
name- the name of the path variable- Returns:
Optional<String>
-
getInt
java.util.OptionalInt getInt(java.lang.String name)
Returns the path variable asinttype by the name given.- Parameters:
name- the name of the path variable- Returns:
OptionalInt
-
getLong
java.util.OptionalLong getLong(java.lang.String name)
Returns the path variable aslongtype by the name given.- Parameters:
name- the name of the path variable- Returns:
OptionalLong
-
getDouble
java.util.OptionalDouble getDouble(java.lang.String name)
Returns the path variable asdoubletype by the name given.- Parameters:
name- the name of the path variable- Returns:
OptionalDouble
-
exists
boolean exists(java.lang.String name)
Returns if the path variable by the name given exists.- Parameters:
name- the name of the path variable- Returns:
trueif the path variable by the name given exists,falseotherwise
-
size
int size()
Returns the size of the path variables.- Returns:
- the size of the path variables
-
names
java.util.Collection<java.lang.String> names()
Returns a collection contains of the names of all path variables.- Returns:
- a collection contains of the names of all path variables
-
-