Class 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 Detail

      • HalPath

        public HalPath()
        Initializes a root
    • 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