Interface VCSModelFactory


  • public interface VCSModelFactory
    This factory is responsible for instantiating model elements implementing the VCSModelElement interface. The default methods provide a sane default implementation.
    • Method Detail

      • createCopy

        default <T> java.util.List<T> createCopy​(java.util.List<T> list)
        Creates a flat copy of list. Returns an empty list if list is null. null values are filtered out.
        Type Parameters:
        T - The type of the values of list.
        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 new Commit. List arguments are flat copied. If any of the given lists is null, 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 - If id, author, message, dateTime, or engine is null.
        java.lang.IllegalArgumentException - If id is empty.
      • createFileChange

        default FileChange createFileChange​(VCSFile oldFile,
                                            VCSFile newFile,
                                            VCSEngine engine)
                                     throws java.lang.NullPointerException,
                                            java.lang.IllegalArgumentException
        Creates a new FileChange.
        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 - If engine is null.
        java.lang.IllegalArgumentException - If oldFile as well as {newFile} is null.
      • 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 new LineChange.
        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 is null.
        java.lang.IllegalArgumentException - If line < 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 new LineInfo.
        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 is null.
        java.lang.IllegalArgumentException - If line < 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 new Revision. List arguments are flat copied. If any of the given lists is null, 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 - If id or engine is null.
        java.lang.IllegalArgumentException - If id is empty.
      • createRevisionRange

        default RevisionRange createRevisionRange​(int ordinal,
                                                  Revision current,
                                                  Revision previous,
                                                  java.util.List<Commit> commits,
                                                  VCSEngine engine)
                                           throws java.lang.NullPointerException,
                                                  java.lang.IllegalArgumentException
        Creates a new RevisionRange. List arguments are flat copied. If any of the given lists is null, an empty list is used as fallback. null values are filtered out.
        Parameters:
        ordinal - The ordinal of the range to create.
        current - The current revision of the range to create.
        previous - The previous revision of the range to create.
        commits - The commits of the range to create.
        engine - The engine of the range to create.
        Returns:
        The created RevisionRange instance.
        Throws:
        java.lang.NullPointerException - If current or engine is null.
        java.lang.IllegalArgumentException - If ordinal < 1 or if commits is empty.
      • createVCSFile

        default VCSFile createVCSFile​(java.lang.String relativePath,
                                      Revision revision,
                                      VCSEngine engine)
                               throws java.lang.NullPointerException,
                                      java.lang.IllegalArgumentException
        Creates a new VCSFile.
        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 is null.
        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 new VCSFile.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 - If file or engine is null.
        java.lang.IllegalArgumentException - If line < 1, column < 1, offset < 0, lineOffset < 0, or tabSize < 1.
      • createRange

        default VCSFile.Range createRange​(VCSFile.Position begin,
                                          VCSFile.Position end,
                                          VCSEngine engine)
                                   throws java.lang.NullPointerException,
                                          java.lang.IllegalArgumentException
        Creates a new VCSFile.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 is null.
        java.lang.IllegalArgumentException - If begin and end reference different files, or if begin is after end.