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, ornull
to infer onepropertySourceFactory
- the type ofPropertySourceFactory
to use, ornull
to use the defaultencoding
- the encoding, ornull
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 Summary
ConstructorDescriptionPropertySourceDescriptor
(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 aPropertySourceDescriptor
record class. -
Method Summary
Modifier and TypeMethodDescriptionencoding()
Returns the value of theencoding
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.boolean
Returns the value of theignoreResourceNotFound
record component.Returns the value of thelocations
record component.name()
Returns the value of thename
record component.Class<? extends PropertySourceFactory>
Returns the value of thepropertySourceFactory
record component.final String
toString()
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 aPropertySourceDescriptor
record class.- Parameters:
locations
- the value for thelocations
record componentignoreResourceNotFound
- the value for theignoreResourceNotFound
record componentname
- the value for thename
record componentpropertySourceFactory
- the value for thepropertySourceFactory
record componentencoding
- the value for theencoding
record 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 thelocations
record component.- Returns:
- the value of the
locations
record component
-
ignoreResourceNotFound
public boolean ignoreResourceNotFound()Returns the value of theignoreResourceNotFound
record component.- Returns:
- the value of the
ignoreResourceNotFound
record component
-
name
Returns the value of thename
record component.- Returns:
- the value of the
name
record component
-
propertySourceFactory
Returns the value of thepropertySourceFactory
record component.- Returns:
- the value of the
propertySourceFactory
record component
-
encoding
Returns the value of theencoding
record component.- Returns:
- the value of the
encoding
record component
-