Record Class GitSource
java.lang.Object
java.lang.Record
org.variantsync.diffdetective.variation.tree.source.GitSource
- All Implemented Interfaces:
VariationTreeSource
public record GitSource(URL repository, String commitHash, Path path)
extends Record
implements VariationTreeSource
A file at a specific commit in a Git repository.
The parameters of this record should be suitably chosen, so that the following commands can be
executed in a shell to obtain the referenced source code:
git clone "$repository" repository
cd repository
git switch -d "$commitHash"
cat "$path"
-
Field Summary
Modifier and TypeFieldDescriptionprivate final String
The field for thecommitHash
record component.private final Path
The field for thepath
record component.private final URL
The field for therepository
record component.Fields inherited from interface org.variantsync.diffdetective.variation.tree.source.VariationTreeSource
Unknown
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecommitHash
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.path()
Returns the value of thepath
record component.Returns the value of therepository
record component.toString()
Returns a string representation of this record class.
-
Field Details
-
repository
The field for therepository
record component. -
commitHash
The field for thecommitHash
record component. -
path
The field for thepath
record component.
-
-
Constructor Details
-
GitSource
Creates an instance of aGitSource
record class.- Parameters:
repository
- the value for therepository
record componentcommitHash
- the value for thecommitHash
record componentpath
- the value for thepath
record component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.- Specified by:
toString
in interfaceVariationTreeSource
- Specified by:
toString
in classRecord
- Returns:
- a string representation of this object
-
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
repository
Returns the value of therepository
record component.- Returns:
- the value of the
repository
record component
-
commitHash
Returns the value of thecommitHash
record component.- Returns:
- the value of the
commitHash
record component
-
path
Returns the value of thepath
record component.- Returns:
- the value of the
path
record component
-