Record Class ContainerImageMetadata
java.lang.Object
java.lang.Record
org.springframework.boot.autoconfigure.container.ContainerImageMetadata
- Record Components:
imageName- the contaimer image name ornullif 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
ConstructorsConstructorDescriptionContainerImageMetadata(String imageName) Creates an instance of aContainerImageMetadatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTo(AttributeAccessor attributes) Add this container image metadata to the given attributes.final booleanIndicates whether some other object is "equal to" this one.static ContainerImageMetadatagetFrom(AttributeAccessor attributes) ReturnContainerImageMetadatafrom the given attributes ornullif no metadata has been added.final inthashCode()Returns a hash code value for this object.Returns the value of theimageNamerecord component.static booleanisPresent(AttributeAccessor attributes) ReturntrueifContainerImageMetadatahas been added to the given attributes.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ContainerImageMetadata
Creates an instance of aContainerImageMetadatarecord class.- Parameters:
imageName- the value for theimageNamerecord component
-
-
Method Details
-
addTo
Add this container image metadata to the given attributes.- Parameters:
attributes- the attributes to add the metadata to
-
isPresent
ReturntrueifContainerImageMetadatahas been added to the given attributes.- Parameters:
attributes- the attributes to check- Returns:
- if metadata is present
-
getFrom
ReturnContainerImageMetadatafrom the given attributes ornullif 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 theimageNamerecord component.- Returns:
- the value of the
imageNamerecord component
-