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
FieldsModifier and TypeFieldDescriptionprivate final StringThe field for thecommitHashrecord component.private final PathThe field for thepathrecord component.private final URLThe field for therepositoryrecord component.Fields inherited from interface org.variantsync.diffdetective.variation.tree.source.VariationTreeSource
Unknown -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecommitHashrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.path()Returns the value of thepathrecord component.Returns the value of therepositoryrecord component.toString()Returns a string representation of this record class.
-
Field Details
-
repository
The field for therepositoryrecord component. -
commitHash
The field for thecommitHashrecord component. -
path
The field for thepathrecord component.
-
-
Constructor Details
-
GitSource
Creates an instance of aGitSourcerecord class.- Parameters:
repository- the value for therepositoryrecord componentcommitHash- the value for thecommitHashrecord componentpath- the value for thepathrecord 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:
toStringin interfaceVariationTreeSource- Specified by:
toStringin 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 therepositoryrecord component.- Returns:
- the value of the
repositoryrecord component
-
commitHash
Returns the value of thecommitHashrecord component.- Returns:
- the value of the
commitHashrecord component
-
path
Returns the value of thepathrecord component.- Returns:
- the value of the
pathrecord component
-