Enum TraversalMode



  • public enum TraversalMode
    extends java.lang.Enum<TraversalMode>
    The TraversalMode specifies on how data in retrieved from a HAL-Resource. HAL-Data is processed depending on the TraversalMode bing provided to the operation. The TraversalMode specifies a combination of the below means:

    Self-HREFs are links to the retrieved data entities themselves and, when enabled by the TraversalMode, are stored below a special Meta-Data section relative to the path of the entity in question.

    Dangling-HREFs are links to the data entities skipped (not retrieved) and, when enabled, are stored below a special Meta-Data section relative to the path of the entity in question.

    Importing children, when enabled by the TraversalMode, instructs the operation in question to retrieve the data referenced by the HREF. This means that the child elements of an entity are retrieved too. Depending on the result of the nextMode() operation, just the direct children are retrieved, all children recursively are retrieved or no children at all are retrieved.

    Dangling HREFs are considered to be those links which were not retrieved as of the TraversalMode and its nextMode() configuration as well as those HREFs which are skipped as of HREF reference cycles which would cause infinite loops upon recursive HREF retrieval.

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      IMPORT_CHILDREN
      Hypermedia references (HREF) pointed to by a path (in terms of a key regarding the concept of the CanonicalMap) are handled as follows: Data related to direct HREFs is imported: Yes Data related to child HREFs is imported recursively: No Self-HREF Meta-Data for retrieved HAL data: No Dangling-HREF Meta-Data for skipped HAL data: No
      IMPORT_CHILDREN_KEEP_DANGLING_HREFS
      Hypermedia references (HREF) pointed to by a path (in terms of a key regarding the concept of the CanonicalMap) are handled as follows: Data related to direct HREFs is imported: Yes Data related to child HREFs is imported recursively: No Self-HREF Meta-Data for retrieved HAL data: No Dangling-HREF Meta-Data for skipped HAL data: Yes
      IMPORT_CHILDREN_KEEP_SELF_HREFS
      Hypermedia references (HREF) pointed to by a path (in terms of a key regarding the concept of the CanonicalMap) are handled as follows: Data related to direct HREFs is imported: Yes Data related to child HREFs is imported recursively: No Self-HREF Meta-Data for retrieved HAL data: Yes Dangling-HREF Meta-Data for skipped HAL data: No
      IMPORT_CHILDREN_KEEP_SELF_HREFS_KEEP_DANGLING_HREFS
      Hypermedia references (HREF) pointed to by a path (in terms of a key regarding the concept of the CanonicalMap) are handled as follows: Data related to direct HREFs is imported: Yes Data related to child HREFs is imported recursively: No Self-HREF Meta-Data for retrieved HAL data: Yes Dangling-HREF Meta-Data for skipped HAL data: Yes
      NONE
      Hypermedia references (HREF) pointed to by a path (in terms of a key regarding the concept of the CanonicalMap) are handled as follows: Data related to direct HREFs is imported: No Data related to child HREFs is imported recursively: No Self-HREF Meta-Data for retrieved HAL data: No Dangling-HREF Meta-Data for skipped HAL data: No
      NONE_KEEP_DANGLING_HREFS
      Hypermedia references (HREF) pointed to by a path (in terms of a key regarding the concept of the CanonicalMap) are handled as follows: Data related to direct HREFs is imported: No Data related to child HREFs is imported recursively: No Self-HREF Meta-Data for retrieved HAL data: No Dangling-HREF Meta-Data for skipped HAL data: Yes
      NONE_KEEP_SELF_HREFS
      Hypermedia references (HREF) pointed to by a path (in terms of a key regarding the concept of the CanonicalMap) are handled as follows: Data related to direct HREFs is imported: No Data related to child HREFs is imported recursively: No Self-HREF Meta-Data for retrieved HAL data: Yes Dangling-HREF Meta-Data for skipped HAL data: No
      NONE_KEEP_SELF_HREFS_KEEP_DANGLING_HREFS
      Hypermedia references (HREF) pointed to by a path (in terms of a key regarding the concept of the CanonicalMap) are handled as follows: Data related to direct HREFs is imported: No Data related to child HREFs is imported recursively: No Self-HREF Meta-Data for retrieved HAL data: Yes Dangling-HREF Meta-Data for skipped HAL data: Yes
      RECURSIVE_IMPORT_CHILDREN
      Hypermedia references (HREF) pointed to by a path (in terms of a key regarding the concept of the CanonicalMap) are handled as follows: Data related to direct HREFs is imported: Yes Data related to child HREFs is imported recursively: Yes Self-HREF Meta-Data for retrieved HAL data: No Dangling-HREF Meta-Data for skipped HAL data: No
      RECURSIVE_IMPORT_CHILDREN_KEEP_DANGLING_HREFS
      Hypermedia references (HREF) pointed to by a path (in terms of a key regarding the concept of the CanonicalMap) are handled as follows: Data related to direct HREFs is imported: Yes Data related to child HREFs is imported recursively: Yes Self-HREF Meta-Data for retrieved HAL data: No Dangling-HREF Meta-Data for skipped HAL data: Yes
      RECURSIVE_IMPORT_CHILDREN_KEEP_SELF_HREFS
      Hypermedia references (HREF) pointed to by a path (in terms of a key regarding the concept of the CanonicalMap) are handled as follows: Data related to direct HREFs is imported: Yes Data related to child HREFs is imported recursively: Yes Self-HREF Meta-Data for retrieved HAL data: Yes Dangling-HREF Meta-Data for skipped HAL data: No
      RECURSIVE_IMPORT_CHILDREN_KEEP_SELF_HREFS_KEEP_DANGLING_HREFS
      Hypermedia references (HREF) pointed to by a path (in terms of a key regarding the concept of the CanonicalMap) are handled as follows: Data related to direct HREFs is imported: Yes Data related to child HREFs is imported recursively: Yes Self-HREF Meta-Data for retrieved HAL data: Yes Dangling-HREF Meta-Data for skipped HAL data: Yes
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isImportChildren​()
      Indicates that HREFs for HAL-Data being loaded are followed and loaded as well.
      boolean isKeepDanglingHrefs​()
      Indicates HREFs for HAL-Data not being loaded (e.g. we have a dangling link) are(!)
      boolean isKeepSelfHrefs​()
      Indicates that HREFs for HAL-Data being loaded are(!)
      TraversalMode nextMode​()
      Returns the next TraversalMode to be applied to the children when the current retrieval operation has finished.
      static TraversalMode valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static TraversalMode[] values​()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • NONE

        public static final TraversalMode NONE
        Hypermedia references (HREF) pointed to by a path (in terms of a key regarding the concept of the CanonicalMap) are handled as follows:
        • Data related to direct HREFs is imported: No
        • Data related to child HREFs is imported recursively: No
        • Self-HREF Meta-Data for retrieved HAL data: No
        • Dangling-HREF Meta-Data for skipped HAL data: No
      • NONE_KEEP_SELF_HREFS

        public static final TraversalMode NONE_KEEP_SELF_HREFS
        Hypermedia references (HREF) pointed to by a path (in terms of a key regarding the concept of the CanonicalMap) are handled as follows:
        • Data related to direct HREFs is imported: No
        • Data related to child HREFs is imported recursively: No
        • Self-HREF Meta-Data for retrieved HAL data: Yes
        • Dangling-HREF Meta-Data for skipped HAL data: No
      • NONE_KEEP_DANGLING_HREFS

        public static final TraversalMode NONE_KEEP_DANGLING_HREFS
        Hypermedia references (HREF) pointed to by a path (in terms of a key regarding the concept of the CanonicalMap) are handled as follows:
        • Data related to direct HREFs is imported: No
        • Data related to child HREFs is imported recursively: No
        • Self-HREF Meta-Data for retrieved HAL data: No
        • Dangling-HREF Meta-Data for skipped HAL data: Yes
      • NONE_KEEP_SELF_HREFS_KEEP_DANGLING_HREFS

        public static final TraversalMode NONE_KEEP_SELF_HREFS_KEEP_DANGLING_HREFS
        Hypermedia references (HREF) pointed to by a path (in terms of a key regarding the concept of the CanonicalMap) are handled as follows:
        • Data related to direct HREFs is imported: No
        • Data related to child HREFs is imported recursively: No
        • Self-HREF Meta-Data for retrieved HAL data: Yes
        • Dangling-HREF Meta-Data for skipped HAL data: Yes
      • IMPORT_CHILDREN

        public static final TraversalMode IMPORT_CHILDREN
        Hypermedia references (HREF) pointed to by a path (in terms of a key regarding the concept of the CanonicalMap) are handled as follows:
        • Data related to direct HREFs is imported: Yes
        • Data related to child HREFs is imported recursively: No
        • Self-HREF Meta-Data for retrieved HAL data: No
        • Dangling-HREF Meta-Data for skipped HAL data: No
      • IMPORT_CHILDREN_KEEP_SELF_HREFS

        public static final TraversalMode IMPORT_CHILDREN_KEEP_SELF_HREFS
        Hypermedia references (HREF) pointed to by a path (in terms of a key regarding the concept of the CanonicalMap) are handled as follows:
        • Data related to direct HREFs is imported: Yes
        • Data related to child HREFs is imported recursively: No
        • Self-HREF Meta-Data for retrieved HAL data: Yes
        • Dangling-HREF Meta-Data for skipped HAL data: No
      • IMPORT_CHILDREN_KEEP_DANGLING_HREFS

        public static final TraversalMode IMPORT_CHILDREN_KEEP_DANGLING_HREFS
        Hypermedia references (HREF) pointed to by a path (in terms of a key regarding the concept of the CanonicalMap) are handled as follows:
        • Data related to direct HREFs is imported: Yes
        • Data related to child HREFs is imported recursively: No
        • Self-HREF Meta-Data for retrieved HAL data: No
        • Dangling-HREF Meta-Data for skipped HAL data: Yes
      • IMPORT_CHILDREN_KEEP_SELF_HREFS_KEEP_DANGLING_HREFS

        public static final TraversalMode IMPORT_CHILDREN_KEEP_SELF_HREFS_KEEP_DANGLING_HREFS
        Hypermedia references (HREF) pointed to by a path (in terms of a key regarding the concept of the CanonicalMap) are handled as follows:
        • Data related to direct HREFs is imported: Yes
        • Data related to child HREFs is imported recursively: No
        • Self-HREF Meta-Data for retrieved HAL data: Yes
        • Dangling-HREF Meta-Data for skipped HAL data: Yes
      • RECURSIVE_IMPORT_CHILDREN

        public static final TraversalMode RECURSIVE_IMPORT_CHILDREN
        Hypermedia references (HREF) pointed to by a path (in terms of a key regarding the concept of the CanonicalMap) are handled as follows:
        • Data related to direct HREFs is imported: Yes
        • Data related to child HREFs is imported recursively: Yes
        • Self-HREF Meta-Data for retrieved HAL data: No
        • Dangling-HREF Meta-Data for skipped HAL data: No
      • RECURSIVE_IMPORT_CHILDREN_KEEP_SELF_HREFS

        public static final TraversalMode RECURSIVE_IMPORT_CHILDREN_KEEP_SELF_HREFS
        Hypermedia references (HREF) pointed to by a path (in terms of a key regarding the concept of the CanonicalMap) are handled as follows:
        • Data related to direct HREFs is imported: Yes
        • Data related to child HREFs is imported recursively: Yes
        • Self-HREF Meta-Data for retrieved HAL data: Yes
        • Dangling-HREF Meta-Data for skipped HAL data: No
      • RECURSIVE_IMPORT_CHILDREN_KEEP_DANGLING_HREFS

        public static final TraversalMode RECURSIVE_IMPORT_CHILDREN_KEEP_DANGLING_HREFS
        Hypermedia references (HREF) pointed to by a path (in terms of a key regarding the concept of the CanonicalMap) are handled as follows:
        • Data related to direct HREFs is imported: Yes
        • Data related to child HREFs is imported recursively: Yes
        • Self-HREF Meta-Data for retrieved HAL data: No
        • Dangling-HREF Meta-Data for skipped HAL data: Yes
      • RECURSIVE_IMPORT_CHILDREN_KEEP_SELF_HREFS_KEEP_DANGLING_HREFS

        public static final TraversalMode RECURSIVE_IMPORT_CHILDREN_KEEP_SELF_HREFS_KEEP_DANGLING_HREFS
        Hypermedia references (HREF) pointed to by a path (in terms of a key regarding the concept of the CanonicalMap) are handled as follows:
        • Data related to direct HREFs is imported: Yes
        • Data related to child HREFs is imported recursively: Yes
        • Self-HREF Meta-Data for retrieved HAL data: Yes
        • Dangling-HREF Meta-Data for skipped HAL data: Yes
    • Method Detail

      • values

        public static TraversalMode[] values​()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (TraversalMode c : TraversalMode.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static TraversalMode valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • isKeepSelfHrefs

        public boolean isKeepSelfHrefs​()
        Indicates that HREFs for HAL-Data being loaded are(!) preserved as values below the according paths of the attributes in question in special Meta-Data sections.

        Self-HREFs are are a result of loaded HAL-Data as of following a HREF.

        Returns:
        True in case the according HREFs are(!) preserved as values below special Meta-Data sections of the according paths.
      • isKeepDanglingHrefs

        public boolean isKeepDanglingHrefs​()
        Indicates HREFs for HAL-Data not being loaded (e.g. we have a dangling link) are(!) preserved below the according paths of the attributes in question in special Meta-Data sections.

        Dangling-HREFs may be a result of not loading direct HREFs or recursive HREFs or we encountered a cycle when loading HREFs recursively.

        Returns:
        True in case the according HREFs are(!) preserved as values below special Meta-Data sections of the according paths.
      • isImportChildren

        public boolean isImportChildren​()
        Indicates that HREFs for HAL-Data being loaded are followed and loaded as well.

        The method nextMode() determines whether the children of this HAL-Data is being loaded as well. Depending on the configuration of the according TraversalMode we may just import the direct childtren of a HAL-Data or all children recursively.

        Returns:
        True in case the according HAL-Data's children are imported as well.
      • nextMode

        public TraversalMode nextMode​()
        Returns the next TraversalMode to be applied to the children when the current retrieval operation has finished.
        Returns:
        The according TraversalMode.