Class PropertySource.MapPropertySource
java.lang.Object
cloud.opencode.base.yml.bind.PropertySource.MapPropertySource
- All Implemented Interfaces:
PropertySource
- Direct Known Subclasses:
PropertySource.YamlPropertySource
- Enclosing interface:
PropertySource
Map-based PropertySource implementation
基于 Map 的 PropertySource 实现
- Since:
- JDK 25, opencode-base-yml V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Nested Class Summary
Nested classes/interfaces inherited from interface PropertySource
PropertySource.EnvironmentPropertySource, PropertySource.MapPropertySource, PropertySource.SystemPropertySource, PropertySource.YamlPropertySource -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsProperty(String path) Checks if a property exists 检查属性是否存在getName()Gets the property source name 获取属性源名称Gets properties as Map 获取属性作为 MapgetProperties(String prefix) Gets properties under a prefix 获取前缀下的属性getProperty(String path) Gets a property value by path 通过路径获取属性值<T> TgetProperty(String path, Class<T> type) Gets a typed property value 获取类型化的属性值Gets all property names 获取所有属性名Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface PropertySource
getOptionalProperty, getProperty, getProperty
-
Constructor Details
-
MapPropertySource
-
-
Method Details
-
getName
Description copied from interface:PropertySourceGets the property source name 获取属性源名称- Specified by:
getNamein interfacePropertySource- Returns:
- source name | 源名称
-
getProperty
Description copied from interface:PropertySourceGets a property value by path 通过路径获取属性值- Specified by:
getPropertyin interfacePropertySource- Parameters:
path- property path | 属性路径- Returns:
- property value or null | 属性值或 null
-
getProperty
Description copied from interface:PropertySourceGets a typed property value 获取类型化的属性值- Specified by:
getPropertyin interfacePropertySource- Type Parameters:
T- type parameter | 类型参数- Parameters:
path- property path | 属性路径type- target type | 目标类型- Returns:
- typed value or null | 类型化值或 null
-
containsProperty
Description copied from interface:PropertySourceChecks if a property exists 检查属性是否存在- Specified by:
containsPropertyin interfacePropertySource- Parameters:
path- property path | 属性路径- Returns:
- true if exists | 如果存在返回 true
-
getPropertyNames
Description copied from interface:PropertySourceGets all property names 获取所有属性名- Specified by:
getPropertyNamesin interfacePropertySource- Returns:
- set of property names | 属性名集合
-
getProperties
Description copied from interface:PropertySourceGets properties as Map 获取属性作为 Map- Specified by:
getPropertiesin interfacePropertySource- Returns:
- property map | 属性映射
-
getProperties
Description copied from interface:PropertySourceGets properties under a prefix 获取前缀下的属性- Specified by:
getPropertiesin interfacePropertySource- Parameters:
prefix- the prefix | 前缀- Returns:
- property map under prefix | 前缀下的属性映射
-