Class ConfigDataLocation
java.lang.Object
org.springframework.boot.context.config.ConfigDataLocation
- All Implemented Interfaces:
- OriginProvider
A user specified location that can be 
resolved to
 one or more config data resources. A
 ConfigDataLocation is a simple wrapper around a String value. The exact
 format of the value will depend on the underlying technology, but is usually a URL like
 syntax consisting of a prefix and path. For example, crypt:somehost/somepath.
 
 Locations can be mandatory or optional. Optional locations are
 prefixed with optional:.
- Since:
- 2.4.0
- Author:
- Phillip Webb
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringPrefix used to indicate that aConfigDataResourceis optional.
- 
Method SummaryModifier and TypeMethodDescriptionbooleangetNonPrefixedValue(String prefix) ReturngetValue()with the specified prefix removed.Return the source origin ornullif the origin is not known.getValue()Return the value of the location (always excluding any user specifiedoptional:prefix).inthashCode()booleanReturn ifgetValue()has the specified prefix.booleanReturn if the location is optional and should ignoreConfigDataNotFoundException.static ConfigDataLocationFactory method to create a newConfigDataLocationfrom a string.split()Return an array ofConfigDataLocationelements built by splitting thisConfigDataLocationaround a delimiter of";".Return an array ofConfigDataLocationelements built by splitting thisConfigDataLocationaround the specified delimiter.toString()
- 
Field Details- 
OPTIONAL_PREFIXPrefix used to indicate that aConfigDataResourceis optional.- See Also:
 
 
- 
- 
Method Details- 
isOptionalpublic boolean isOptional()Return if the location is optional and should ignoreConfigDataNotFoundException.- Returns:
- if the location is optional
 
- 
getValueReturn the value of the location (always excluding any user specifiedoptional:prefix).- Returns:
- the location value
 
- 
hasPrefixReturn ifgetValue()has the specified prefix.- Parameters:
- prefix- the prefix to check
- Returns:
- if the value has the prefix
 
- 
getNonPrefixedValueReturngetValue()with the specified prefix removed. If the location does not have the given prefix then thegetValue()is returned unchanged.- Parameters:
- prefix- the prefix to check
- Returns:
- the value with the prefix removed
 
- 
getOriginDescription copied from interface:OriginProviderReturn the source origin ornullif the origin is not known.- Specified by:
- getOriginin interface- OriginProvider
- Returns:
- the origin or null
 
- 
splitReturn an array ofConfigDataLocationelements built by splitting thisConfigDataLocationaround a delimiter of";".- Returns:
- the split locations
- Since:
- 2.4.7
 
- 
splitReturn an array ofConfigDataLocationelements built by splitting thisConfigDataLocationaround the specified delimiter.- Parameters:
- delimiter- the delimiter to split on
- Returns:
- the split locations
- Since:
- 2.4.7
 
- 
equals
- 
hashCodepublic int hashCode()
- 
toString
- 
ofFactory method to create a newConfigDataLocationfrom a string.- Parameters:
- location- the location string
- Returns:
- a ConfigDataLocationinstance ornullif no location was provided
 
 
-