Class RepositoryFileTree
- java.lang.Object
-
- org.pentaho.platform.api.repository2.unified.RepositoryFileTree
-
- All Implemented Interfaces:
Serializable
,Comparable<RepositoryFileTree>
public class RepositoryFileTree extends Object implements Comparable<RepositoryFileTree>, Serializable
A struct for aRepositoryFile
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. ARepositoryFile
is meant to be a lightweight object representing metadata about a file in isolation. It does not have references to otherRepositoryFile
instances. The potential for misuse of a children field onRepositoryFile
was great enough to warrant the creation ofRepositoryFileTree
. This separation of single file vs. tree is seen as a cleaner API with less confusion about when children is populated.- Author:
- mlowery
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RepositoryFileTree.Builder
-
Constructor Summary
Constructors Constructor Description RepositoryFileTree(RepositoryFile file, List<RepositoryFileTree> children)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(RepositoryFileTree other)
Compare is based on the root file.boolean
equals(Object obj)
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.RepositoryFile
getFile()
Boolean
getVersionCommentEnabled()
Boolean
getVersioningEnabled()
int
hashCode()
void
setVersionCommentEnabled(Boolean versionCommentEnabled)
void
setVersioningEnabled(Boolean versioningEnabled)
String
toString()
protected String
toString(int depth)
-
-
-
Constructor Detail
-
RepositoryFileTree
public RepositoryFileTree(RepositoryFile file, List<RepositoryFileTree> children)
-
-
Method Detail
-
getFile
public RepositoryFile getFile()
-
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
- Returns:
-
compareTo
public int compareTo(RepositoryFileTree other)
Compare is based on the root file.- Specified by:
compareTo
in interfaceComparable<RepositoryFileTree>
-
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)
-
-