Interface VCSModelFactory
-
public interface VCSModelFactory
This factory is responsible for instantiating model elements implementing theVCSModelElement
interface. The default methods provide a sane default implementation.
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default Commit
createCommit(java.lang.String id, java.lang.String author, java.lang.String message, java.time.LocalDateTime dateTime, java.util.List<java.lang.String> parentIds, java.util.List<FileChange> fileChanges, java.util.List<Issue> issues, VCSEngine engine)
Creates a newCommit
.default <T> java.util.List<T>
createCopy(java.util.List<T> list)
Creates a flat copy oflist
.default FileChange
createFileChange(VCSFile oldFile, VCSFile newFile, VCSEngine engine)
Creates a newFileChange
.default LineChange
createLineChange(LineChange.Type type, int line, java.lang.String content, VCSFile file, VCSEngine engine)
Creates a newLineChange
.default LineInfo
createLineInfo(java.lang.String id, java.lang.String author, java.lang.String message, java.time.LocalDateTime dateTime, int line, java.lang.String content, VCSFile file, VCSEngine engine)
Creates a newLineInfo
.default VCSFile.Position
createPosition(VCSFile file, int line, int column, int offset, int lineOffset, int tabSize, VCSEngine engine)
Creates a newVCSFile.Position
.default VCSFile.Range
createRange(VCSFile.Position begin, VCSFile.Position end, VCSEngine engine)
Creates a newVCSFile.Range
.default Revision
createRevision(java.lang.String id, java.util.List<java.lang.String> files, VCSEngine engine)
Creates a newRevision
.default RevisionRange
createRevisionRange(int ordinal, Revision revision, Revision predecessorRevision, java.util.List<Commit> commits, VCSEngine engine)
Creates a newRevisionRange
.default VCSFile
createVCSFile(java.lang.String relativePath, Revision revision, VCSEngine engine)
Creates a newVCSFile
.
-
-
-
Method Detail
-
createCopy
default <T> java.util.List<T> createCopy(java.util.List<T> list)
Creates a flat copy oflist
. Returns an empty list iflist
isnull
.null
values are filtered out.- Type Parameters:
T
- The type of the values oflist
.- Parameters:
list
- The list to copy.- Returns:
- The copied list.
-
createCommit
default Commit createCommit(java.lang.String id, java.lang.String author, java.lang.String message, java.time.LocalDateTime dateTime, java.util.List<java.lang.String> parentIds, java.util.List<FileChange> fileChanges, java.util.List<Issue> issues, VCSEngine engine) throws java.lang.NullPointerException, java.lang.IllegalArgumentException
Creates a newCommit
. List arguments are flat copied. If any of the given lists isnull
, an empty list is used as fallback.null
values are filtered out.- Parameters:
id
- The id of the commit to create.author
- The author of the commit to create.message
- The message of the commit to create.dateTime
- The datetime of the commit to create.parentIds
- The parent ids of the commit to create.fileChanges
- The file changes of the commit to create.issues
- The issues of the commit to create.engine
- The engine of the commit to create.- Returns:
- The created
Commit
instance. - Throws:
java.lang.NullPointerException
- Ifid
,author
,message
,dateTime
, orengine
isnull
.java.lang.IllegalArgumentException
- Ifid
is empty.
-
createFileChange
default FileChange createFileChange(VCSFile oldFile, VCSFile newFile, VCSEngine engine) throws java.lang.NullPointerException, java.lang.IllegalArgumentException
Creates a newFileChange
.- Parameters:
oldFile
- The old file of the file change to create.newFile
- The new file of the file change to create.engine
- The engine of the file change to create.- Returns:
- The created
FileChange
instance. - Throws:
java.lang.NullPointerException
- Ifengine
isnull
.java.lang.IllegalArgumentException
- IfoldFile
as well as {newFile} isnull
.
-
createLineChange
default LineChange createLineChange(LineChange.Type type, int line, java.lang.String content, VCSFile file, VCSEngine engine) throws java.lang.NullPointerException, java.lang.IllegalArgumentException
Creates a newLineChange
.- Parameters:
type
- The type of the line change to create.line
- The line number of the line change to create.content
- The content of the line change to create.file
- The file of the line change to create.engine
- The engine of the line change to create.- Returns:
- The created
LineChange
instance. - Throws:
java.lang.NullPointerException
- If any of the given arguments isnull
.java.lang.IllegalArgumentException
- Ifline < 1
.
-
createLineInfo
default LineInfo createLineInfo(java.lang.String id, java.lang.String author, java.lang.String message, java.time.LocalDateTime dateTime, int line, java.lang.String content, VCSFile file, VCSEngine engine) throws java.lang.NullPointerException, java.lang.IllegalArgumentException
Creates a newLineInfo
.- Parameters:
id
- The id of the line info to create.author
- The author of the line info to create.message
- The message of the line info to create.dateTime
- The datetime of the line info to create.line
- The line number of the line info to create.content
- The content of the line info to create.file
- The file of the line info to create.engine
- The engine of the line info to create.- Returns:
- The created
LineInfo
instance. - Throws:
java.lang.NullPointerException
- If any of the given arguments isnull
.java.lang.IllegalArgumentException
- Ifline < 1
.
-
createRevision
default Revision createRevision(java.lang.String id, java.util.List<java.lang.String> files, VCSEngine engine) throws java.lang.NullPointerException, java.lang.IllegalArgumentException
Creates a newRevision
. List arguments are flat copied. If any of the given lists isnull
, an empty list is used as fallback.null
values are filtered out.- Parameters:
id
- The id of the revision to create.files
- The files (relative paths) of the revision to create.engine
- The engine of the revision to create.- Returns:
- The created
Revision
instance. - Throws:
java.lang.NullPointerException
- Ifid
orengine
isnull
.java.lang.IllegalArgumentException
- Ifid
is empty.
-
createRevisionRange
default RevisionRange createRevisionRange(int ordinal, Revision revision, Revision predecessorRevision, java.util.List<Commit> commits, VCSEngine engine) throws java.lang.NullPointerException, java.lang.IllegalArgumentException
Creates a newRevisionRange
. List arguments are flat copied. If any of the given lists isnull
, an empty list is used as fallback.null
values are filtered out.- Parameters:
ordinal
- The ordinal of the revision range to create.revision
- The revision of the revision range to create.predecessorRevision
- The predecessor revision of the revision range to create.commits
- The commits of the revision range to create.engine
- The engine of the revision range to create.- Returns:
- The created
RevisionRange
instance. - Throws:
java.lang.NullPointerException
- Ifrevision
orengine
isnull
.java.lang.IllegalArgumentException
- Ifordinal < 1
or ifcommits
is empty.
-
createVCSFile
default VCSFile createVCSFile(java.lang.String relativePath, Revision revision, VCSEngine engine) throws java.lang.NullPointerException, java.lang.IllegalArgumentException
Creates a newVCSFile
.- Parameters:
relativePath
- The relative path of the file to create.revision
- The revision of the file to create.engine
- The engine of the file to create.- Returns:
- The created
VCSFile
instance. - Throws:
java.lang.NullPointerException
- If any of the given arguments isnull
.java.lang.IllegalArgumentException
-
createPosition
default VCSFile.Position createPosition(VCSFile file, int line, int column, int offset, int lineOffset, int tabSize, VCSEngine engine) throws java.lang.NullPointerException, java.lang.IllegalArgumentException
Creates a newVCSFile.Position
.- Parameters:
file
- The referenced file of the position to create.line
- The line of the position to create.column
- The column of the position to create.offset
- The offset of the position to create.lineOffset
- The line offset of the position to create.tabSize
- The tab size of the position to create.engine
- The engine of the position to create.- Throws:
java.lang.NullPointerException
- Iffile
orengine
isnull
.java.lang.IllegalArgumentException
- Ifline < 1
,column < 1
,offset < 0
,lineOffset < 0
, ortabSize < 1
.
-
createRange
default VCSFile.Range createRange(VCSFile.Position begin, VCSFile.Position end, VCSEngine engine) throws java.lang.NullPointerException, java.lang.IllegalArgumentException
Creates a newVCSFile.Range
.- Parameters:
begin
- The begin position of the range to create.end
- The end position of the range to create.engine
- The engine of the position to create.- Throws:
java.lang.NullPointerException
- If any of the given arguments isnull
.java.lang.IllegalArgumentException
- Ifbegin
andend
reference different files, or ifbegin
is afterend
.
-
-