Record Class ContainerImageMetadata
java.lang.Object
java.lang.Record
org.springframework.boot.autoconfigure.container.ContainerImageMetadata
- Record Components:
imageName
- the contaimer image name ornull
if the image name is not yet known
Metadata about a container image that can be added to an
AttributeAccessor
.
Primarily designed to be attached to BeanDefinitions
created in
support of Testcontainers or Docker Compose.- Since:
- 3.4.0
- Author:
- Phillip Webb
-
Constructor Summary
ConstructorDescriptionContainerImageMetadata
(String imageName) Creates an instance of aContainerImageMetadata
record class. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addTo
(AttributeAccessor attributes) Add this container image metadata to the given attributes.final boolean
Indicates whether some other object is "equal to" this one.static ContainerImageMetadata
getFrom
(AttributeAccessor attributes) ReturnContainerImageMetadata
from the given attributes ornull
if no metadata has been added.final int
hashCode()
Returns a hash code value for this object.Returns the value of theimageName
record component.static boolean
isPresent
(AttributeAccessor attributes) Returntrue
ifContainerImageMetadata
has been added to the given attributes.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
ContainerImageMetadata
Creates an instance of aContainerImageMetadata
record class.- Parameters:
imageName
- the value for theimageName
record component
-
-
Method Details
-
addTo
Add this container image metadata to the given attributes.- Parameters:
attributes
- the attributes to add the metadata to
-
isPresent
Returntrue
ifContainerImageMetadata
has been added to the given attributes.- Parameters:
attributes
- the attributes to check- Returns:
- if metadata is present
-
getFrom
ReturnContainerImageMetadata
from the given attributes ornull
if no metadata has been added.- Parameters:
attributes
- the attributes- Returns:
- the metadata or
null
-
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)
. -
imageName
Returns the value of theimageName
record component.- Returns:
- the value of the
imageName
record component
-