Record Class GitHubRepoNameBag
java.lang.Object
java.lang.Record
com.atlassian.bamboo.plugins.github.GitHubRepoNameBag
A record that represents the owner and name of a GitHub repository.
-
Constructor Summary
ConstructorsConstructorDescriptionGitHubRepoNameBag(String owner, String name) Creates an instance of aGitHubRepoNameBagrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.static GitHubRepoNameBagCreates a new `GitHubRepoNameBag` from the full repository name.owner()Returns the value of theownerrecord component.static @NotNull String[]splitRepositoryFullName(String repositoryFullName) Splits the full repository name into owner and name.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
GitHubRepoNameBag
Creates an instance of aGitHubRepoNameBagrecord class.- Parameters:
owner- the value for theownerrecord componentname- the value for thenamerecord component
-
-
Method Details
-
of
Creates a new `GitHubRepoNameBag` from the full repository name.- Parameters:
fullName- the full repository name in the format "owner/name"- Returns:
- a new `GitHubRepoNameBag` instance
- Throws:
IllegalArgumentException- if the full name is not in the correct format
-
splitRepositoryFullName
Splits the full repository name into owner and name.- Parameters:
repositoryFullName- the full repository name in the format "owner/name"- Returns:
- an array containing the owner and name
- Throws:
IllegalArgumentException- if the full name is not in the correct format
-
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. -
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). -
owner
Returns the value of theownerrecord component.- Returns:
- the value of the
ownerrecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-