Interface Revision
-
- All Superinterfaces:
VCSModelElement
public interface Revision extends VCSModelElement
Represents the state of a VCS at a certain point in time.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.List<VCSFile>
getFiles()
Returns all non-VCS-specific files.default java.util.List<VCSFile>
getFilesByPrefix(java.lang.String prefix)
Filters the list of files returned bygetFiles()
and returns only those whose relative path start withprefix
.default java.util.List<VCSFile>
getFilesByRegex(java.lang.String regex)
Filters the list of files returned bygetFiles()
and returns only those whose relative path matchregex
.default java.util.List<VCSFile>
getFilesBySuffix(java.lang.String suffix)
Filters the list of files returned bygetFiles()
and returns only those whose relative path end withsuffix
.java.lang.String
getId()
Returns the id of this revision.default java.nio.file.Path
getOutput()
-
Methods inherited from interface de.unibremen.informatik.st.libvcs4j.VCSModelElement
getVCSEngine
-
-
-
-
Method Detail
-
getId
java.lang.String getId()
Returns the id of this revision. Usually, it is the id of the commit that yields to this revision. However, a VCS may use a dedicated id to identify commits and revisions independently.- Returns:
- The id of this revision.
-
getOutput
default java.nio.file.Path getOutput()
- Returns:
- The path to the tracked files and directories.
- See Also:
VCSEngine.getOutput()
-
getFiles
java.util.List<VCSFile> getFiles()
Returns all non-VCS-specific files.- Returns:
- All non-VCS-specific files.
-
getFilesBySuffix
default java.util.List<VCSFile> getFilesBySuffix(java.lang.String suffix)
Filters the list of files returned bygetFiles()
and returns only those whose relative path end withsuffix
. You may use this method to analyze a certain file type only. For instance, callgetFilesBySuffix(".java")
to get only Java files.- Parameters:
suffix
- The suffix used to filter the files.- Returns:
- All files whose relative path end with
suffix
.
-
getFilesByPrefix
default java.util.List<VCSFile> getFilesByPrefix(java.lang.String prefix)
Filters the list of files returned bygetFiles()
and returns only those whose relative path start withprefix
. You may use this method to analyze files located in a certain directory only. For instance, callgetFilesByPrefix("src/main/java")
to get only the files located in "src/main/java".- Parameters:
prefix
- The prefix used to filter the files.- Returns:
- All files whose relative path start with
prefix
.
-
getFilesByRegex
default java.util.List<VCSFile> getFilesByRegex(java.lang.String regex)
Filters the list of files returned bygetFiles()
and returns only those whose relative path matchregex
. Paths are matched usingString.matches(String)
.- Parameters:
regex
- The regular expression used to filter the files.- Returns:
- All files whose relative path match match
regex
.
-
-