Package com.jcabi.github
Class FileChange.Smart
java.lang.Object
com.jcabi.github.FileChange.Smart
- All Implemented Interfaces:
FileChange,JsonReadable
- Enclosing interface:
- FileChange
@Immutable
@Loggable(1)
public static final class FileChange.Smart
extends Object
implements FileChange
Smart file change with extra features.
- Since:
- 0.24
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.jcabi.github.FileChange
FileChange.Smart, FileChange.Status -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintNumber of lines added, or 0 if the file is binary.blobUrl()URL for the file's git blob.intchanges()Number of lines modified, which is equal to the sum ofadditions()anddeletions().Repo contents URL for the file.intNumber of lines deleted, or 0 if the file is binary.filename()File's name.jakarta.json.JsonObjectjson()Describe it in a JSON object.com.google.common.base.Optional<String>patch()Diff string of the changes to the file.rawUrl()URL for the raw contents of the file.sha()File's commit SHA.status()Status of the file in this change.
-
Constructor Details
-
Smart
Public ctor.- Parameters:
chng- File change
-
-
Method Details
-
sha
File's commit SHA.- Returns:
- SHA
- Throws:
IOException- If there is any I/O problem
-
filename
File's name. Includes the path to the file from the root directory of the repository. Does not start with a forward slash. Example: "foo/bar/baz.txt"- Returns:
- Filename
- Throws:
IOException- If there is any I/O problem
-
status
Status of the file in this change.- Returns:
- File status
- Throws:
IOException- If there is any I/O problem
-
additions
Number of lines added, or 0 if the file is binary.- Returns:
- Number of lines added
- Throws:
IOException- If there is any I/O problem
-
deletions
Number of lines deleted, or 0 if the file is binary.- Returns:
- Number of lines deleted
- Throws:
IOException- If there is any I/O problem
-
changes
Number of lines modified, which is equal to the sum ofadditions()anddeletions().- Returns:
- Number of lines modified
- Throws:
IOException- If there is any I/O problem
-
patch
Diff string of the changes to the file. Only available if the file is text (as opposed to binary).- Returns:
- Diff string
- Throws:
IOException- If there is any I/O problem
-
rawUrl
URL for the raw contents of the file.- Returns:
- URL
- Throws:
IOException- If there is any I/O problem
-
blobUrl
URL for the file's git blob.- Returns:
- URL
- Throws:
IOException- If there is any I/O problem
-
contentsUrl
Repo contents URL for the file.- Returns:
- URL
- Throws:
IOException- If there is any I/O problem
-
json
Description copied from interface:JsonReadableDescribe it in a JSON object.- Specified by:
jsonin interfaceJsonReadable- Returns:
- JSON object
- Throws:
IOException- If there is any I/O problem
-