类 ConfigDataLocation
java.lang.Object
org.springframework.boot.context.config.ConfigDataLocation
- 所有已实现的接口:
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:
.
- 从以下版本开始:
- 2.4.0
- 作者:
- Phillip Webb
-
字段概要
字段 -
方法概要
修饰符和类型方法说明boolean
getNonPrefixedValue
(String prefix) ReturngetValue()
with the specified prefix removed.Return the source origin ornull
if the origin is not known.getValue()
Return the value of the location (always excluding any user specifiedoptional:
prefix).int
hashCode()
boolean
Return ifgetValue()
has the specified prefix.boolean
Return if the location is optional and should ignoreConfigDataNotFoundException
.static ConfigDataLocation
Factory method to create a newConfigDataLocation
from a string.split()
Return an array ofConfigDataLocation
elements built by splitting thisConfigDataLocation
around a delimiter of";"
.Return an array ofConfigDataLocation
elements built by splitting thisConfigDataLocation
around the specified delimiter.toString()
-
字段详细资料
-
OPTIONAL_PREFIX
Prefix used to indicate that aConfigDataResource
is optional.- 另请参阅:
-
-
方法详细资料
-
isOptional
public boolean isOptional()Return if the location is optional and should ignoreConfigDataNotFoundException
.- 返回:
- if the location is optional
-
getValue
Return the value of the location (always excluding any user specifiedoptional:
prefix).- 返回:
- the location value
-
hasPrefix
Return ifgetValue()
has the specified prefix.- 参数:
prefix
- the prefix to check- 返回:
- if the value has the prefix
-
getNonPrefixedValue
ReturngetValue()
with the specified prefix removed. If the location does not have the given prefix then thegetValue()
is returned unchanged.- 参数:
prefix
- the prefix to check- 返回:
- the value with the prefix removed
-
getOrigin
从接口复制的说明:OriginProvider
Return the source origin ornull
if the origin is not known.- 指定者:
getOrigin
在接口中OriginProvider
- 返回:
- the origin or
null
-
split
Return an array ofConfigDataLocation
elements built by splitting thisConfigDataLocation
around a delimiter of";"
.- 返回:
- the split locations
- 从以下版本开始:
- 2.4.7
-
split
Return an array ofConfigDataLocation
elements built by splitting thisConfigDataLocation
around the specified delimiter.- 参数:
delimiter
- the delimiter to split on- 返回:
- the split locations
- 从以下版本开始:
- 2.4.7
-
equals
-
hashCode
public int hashCode() -
toString
-
of
Factory method to create a newConfigDataLocation
from a string.- 参数:
location
- the location string- 返回:
- a
ConfigDataLocation
instance ornull
if no location was provided
-