Class HalPath
- java.lang.Object
-
- io.wcm.caravan.pipeline.extensions.hal.filter.HalPath
-
@ProviderType public final class HalPath extends Object
Represents a path of embedded resources in a HAL resource by concatenating the relation names of the embedded ones.
-
-
Constructor Summary
Constructors Constructor Description HalPath()
Initializes a root
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HalPath
add(String relation)
Adds a relation to the pathString
current()
String
first()
String
get(int index)
String
last(int last)
Returns the n-th last relations name in the pathint
size()
String
toString()
-
-
-
Method Detail
-
add
public HalPath add(String relation)
Adds a relation to the path- Parameters:
relation
- Relation name of the embedded resource- Returns:
- New HAL path
-
get
public String get(int index)
- Parameters:
index
- Position in the path- Returns:
- Relation for the given index. Can be null
-
first
public String first()
- Returns:
- The first relation name in the path. Can be null
-
current
public String current()
- Returns:
- Relation name of the current embedded resource
- See Also:
last(int)
-
last
public String last(int last)
Returns the n-th last relations name in the path- Parameters:
last
- Step from the end of the path- Returns:
- Relation name. Can be
null
-
size
public int size()
- Returns:
- Number of relation names
-
-