Record Class PropertySourceDescriptor
java.lang.Object
java.lang.Record
org.springframework.core.io.support.PropertySourceDescriptor
- Record Components:
locations- the locations to considerignoreResourceNotFound- whether a failure to find a property resource should be ignoredname- the name of the property source, ornullto infer onepropertySourceFactory- the type ofPropertySourceFactoryto use, ornullto use the defaultencoding- the encoding, ornullto 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 Summary
ConstructorsConstructorDescriptionPropertySourceDescriptor(String... locations) Create a descriptor with the specified locations.PropertySourceDescriptor(List<String> locations, boolean ignoreResourceNotFound, String name, Class<? extends PropertySourceFactory> propertySourceFactory, String encoding) Creates an instance of aPropertySourceDescriptorrecord class. -
Method Summary
Modifier and TypeMethodDescriptionencoding()Returns the value of theencodingrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theignoreResourceNotFoundrecord component.Returns the value of thelocationsrecord component.name()Returns the value of thenamerecord component.Class<? extends PropertySourceFactory>Returns the value of thepropertySourceFactoryrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PropertySourceDescriptor
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 aPropertySourceDescriptorrecord class.- Parameters:
locations- the value for thelocationsrecord componentignoreResourceNotFound- the value for theignoreResourceNotFoundrecord componentname- the value for thenamerecord componentpropertySourceFactory- the value for thepropertySourceFactoryrecord componentencoding- the value for theencodingrecord 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
locations
Returns the value of thelocationsrecord component.- Returns:
- the value of the
locationsrecord component
-
ignoreResourceNotFound
public boolean ignoreResourceNotFound()Returns the value of theignoreResourceNotFoundrecord component.- Returns:
- the value of the
ignoreResourceNotFoundrecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
propertySourceFactory
Returns the value of thepropertySourceFactoryrecord component.- Returns:
- the value of the
propertySourceFactoryrecord component
-
encoding
Returns the value of theencodingrecord component.- Returns:
- the value of the
encodingrecord component
-