Record Class ContainerImageMetadata

java.lang.Object
java.lang.Record
org.springframework.boot.autoconfigure.container.ContainerImageMetadata
Record Components:
imageName - the contaimer image name or null if the image name is not yet known

public record ContainerImageMetadata(String imageName) extends Record
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 Details

    • ContainerImageMetadata

      public ContainerImageMetadata(String imageName)
      Creates an instance of a ContainerImageMetadata record class.
      Parameters:
      imageName - the value for the imageName record component
  • Method Details

    • addTo

      public void addTo(AttributeAccessor attributes)
      Add this container image metadata to the given attributes.
      Parameters:
      attributes - the attributes to add the metadata to
    • isPresent

      public static boolean isPresent(AttributeAccessor attributes)
      Return true if ContainerImageMetadata has been added to the given attributes.
      Parameters:
      attributes - the attributes to check
      Returns:
      if metadata is present
    • getFrom

      public static ContainerImageMetadata getFrom(AttributeAccessor attributes)
      Return ContainerImageMetadata from the given attributes or null if no metadata has been added.
      Parameters:
      attributes - the attributes
      Returns:
      the metadata or null
    • toString

      public final String 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:
      toString in class Record
      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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • imageName

      public String imageName()
      Returns the value of the imageName record component.
      Returns:
      the value of the imageName record component