类 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
-
字段概要
字段 -
方法概要
修饰符和类型方法说明booleangetNonPrefixedValue(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()
-
字段详细资料
-
OPTIONAL_PREFIX
Prefix used to indicate that aConfigDataResourceis 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
从接口复制的说明:OriginProviderReturn the source origin ornullif the origin is not known.- 指定者:
getOrigin在接口中OriginProvider- 返回:
- the origin or
null
-
split
Return an array ofConfigDataLocationelements built by splitting thisConfigDataLocationaround a delimiter of";".- 返回:
- the split locations
- 从以下版本开始:
- 2.4.7
-
split
Return an array ofConfigDataLocationelements built by splitting thisConfigDataLocationaround 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 newConfigDataLocationfrom a string.- 参数:
location- the location string- 返回:
- a
ConfigDataLocationinstance ornullif no location was provided
-