Class RepositoryFileTree

  • All Implemented Interfaces:
    Serializable, Comparable<RepositoryFileTree>

    public class RepositoryFileTree
    extends Object
    implements Comparable<RepositoryFileTree>, Serializable
    A struct for a RepositoryFile and its immediate children.* The immediate children is a list of this type (which can have children and so on). This class is immutable.

    * This is necessary since a RepositoryFile does not (by design) have a reference to its children. A RepositoryFile is meant to be a lightweight object representing metadata about a file in isolation. It does not have references to other RepositoryFile instances. The potential for misuse of a children field on RepositoryFile was great enough to warrant the creation of RepositoryFileTree. This separation of single file vs. tree is seen as a cleaner API with less confusion about when children is populated.

    See Also:
    Serialized Form
    • Method Detail

      • getChildren

        public List<RepositoryFileTree> getChildren()
        Children can have one of three values:
        • null: children were not fetched; used for operations that support depth
        • empty list: there are no children for this file (i.e. file is not a folder or folder has no children)
        • non-empty list: this file is a folder and it has children
      • hashCode

        public int hashCode()
        hashCode in class Object
      • toString

        protected String toString​(int depth)
      • getVersioningEnabled

        public Boolean getVersioningEnabled()
      • setVersioningEnabled

        public void setVersioningEnabled​(Boolean versioningEnabled)
      • getVersionCommentEnabled

        public Boolean getVersionCommentEnabled()
      • setVersionCommentEnabled

        public void setVersionCommentEnabled​(Boolean versionCommentEnabled)