Record Class PropertySourceDescriptor

java.lang.Object
java.lang.Record
org.springframework.core.io.support.PropertySourceDescriptor
Record Components:
locations - the locations to consider
ignoreResourceNotFound - whether a failure to find a property resource should be ignored
name - the name of the property source, or null to infer one
propertySourceFactory - the type of PropertySourceFactory to use, or null to use the default
encoding - the encoding, or null to use the default encoding

public record PropertySourceDescriptor(List<String> locations, boolean ignoreResourceNotFound, String name, Class<? extends PropertySourceFactory> propertySourceFactory, String encoding) extends Record
Descriptor for a PropertySource.
Since:
6.0
Author:
Stephane Nicoll
See Also:
  • Constructor Details

    • PropertySourceDescriptor

      public PropertySourceDescriptor(String... locations)
      Create a descriptor with the specified locations.
      Parameters:
      locations - the locations to consider
    • PropertySourceDescriptor

      public PropertySourceDescriptor(List<String> locations, boolean ignoreResourceNotFound, @Nullable String name, @Nullable Class<? extends PropertySourceFactory> propertySourceFactory, @Nullable String encoding)
      Creates an instance of a PropertySourceDescriptor record class.
      Parameters:
      locations - the value for the locations record component
      ignoreResourceNotFound - the value for the ignoreResourceNotFound record component
      name - the value for the name record component
      propertySourceFactory - the value for the propertySourceFactory record component
      encoding - the value for the encoding record component
  • Method Details

    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • locations

      public List<String> locations()
      Returns the value of the locations record component.
      Returns:
      the value of the locations record component
    • ignoreResourceNotFound

      public boolean ignoreResourceNotFound()
      Returns the value of the ignoreResourceNotFound record component.
      Returns:
      the value of the ignoreResourceNotFound record component
    • name

      @Nullable public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • propertySourceFactory

      @Nullable public Class<? extends PropertySourceFactory> propertySourceFactory()
      Returns the value of the propertySourceFactory record component.
      Returns:
      the value of the propertySourceFactory record component
    • encoding

      @Nullable public String encoding()
      Returns the value of the encoding record component.
      Returns:
      the value of the encoding record component