Package org.apache.maven.cling.transfer
Record Class TransferResourceIdentifier
java.lang.Object
java.lang.Record
org.apache.maven.cling.transfer.TransferResourceIdentifier
record TransferResourceIdentifier(String repositoryId, String repositoryUrl, String resourceName, @Nullable Path file)
extends Record
Immutable identifier of a
TransferResource
.
The TransferResource
is not immutable and does not implement Objects#equals
and Objects#hashCode
methods,
making it not very suitable for usage in collections.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Path
The field for thefile
record component.private final String
The field for therepositoryId
record component.private final String
The field for therepositoryUrl
record component.private final String
The field for theresourceName
record component. -
Constructor Summary
ConstructorsConstructorDescriptionTransferResourceIdentifier
(String repositoryId, String repositoryUrl, String resourceName, Path file) Creates an instance of aTransferResourceIdentifier
record class.TransferResourceIdentifier
(org.eclipse.aether.transfer.TransferResource resource) -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.file()
Returns the value of thefile
record component.final int
hashCode()
Returns a hash code value for this object.Returns the value of therepositoryId
record component.Returns the value of therepositoryUrl
record component.Returns the value of theresourceName
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
repositoryId
The field for therepositoryId
record component. -
repositoryUrl
The field for therepositoryUrl
record component. -
resourceName
The field for theresourceName
record component. -
file
The field for thefile
record component.
-
-
Constructor Details
-
TransferResourceIdentifier
TransferResourceIdentifier(org.eclipse.aether.transfer.TransferResource resource) -
TransferResourceIdentifier
TransferResourceIdentifier(String repositoryId, String repositoryUrl, String resourceName, @Nullable Path file) Creates an instance of aTransferResourceIdentifier
record class.- Parameters:
repositoryId
- the value for therepositoryId
record componentrepositoryUrl
- the value for therepositoryUrl
record componentresourceName
- the value for theresourceName
record componentfile
- the value for thefile
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. -
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)
. -
repositoryId
Returns the value of therepositoryId
record component.- Returns:
- the value of the
repositoryId
record component
-
repositoryUrl
Returns the value of therepositoryUrl
record component.- Returns:
- the value of the
repositoryUrl
record component
-
resourceName
Returns the value of theresourceName
record component.- Returns:
- the value of the
resourceName
record component
-
file
Returns the value of thefile
record component.- Returns:
- the value of the
file
record component
-