Class PropertySource.EnvironmentPropertySource

java.lang.Object
cloud.opencode.base.yml.bind.PropertySource.EnvironmentPropertySource
All Implemented Interfaces:
PropertySource
Enclosing interface:
PropertySource

public static class PropertySource.EnvironmentPropertySource extends Object implements PropertySource
Environment variable PropertySource 环境变量 PropertySource
Since:
JDK 25, opencode-base-yml V1.0.0
Author:
Leon Soo www.LeonSoo.com
  • Constructor Details

    • EnvironmentPropertySource

      public EnvironmentPropertySource()
  • Method Details

    • getName

      public String getName()
      Description copied from interface: PropertySource
      Gets the property source name 获取属性源名称
      Specified by:
      getName in interface PropertySource
      Returns:
      source name | 源名称
    • getProperty

      public String getProperty(String path)
      Description copied from interface: PropertySource
      Gets a property value by path 通过路径获取属性值
      Specified by:
      getProperty in interface PropertySource
      Parameters:
      path - property path | 属性路径
      Returns:
      property value or null | 属性值或 null
    • getProperty

      public <T> T getProperty(String path, Class<T> type)
      Description copied from interface: PropertySource
      Gets a typed property value 获取类型化的属性值
      Specified by:
      getProperty in interface PropertySource
      Type Parameters:
      T - type parameter | 类型参数
      Parameters:
      path - property path | 属性路径
      type - target type | 目标类型
      Returns:
      typed value or null | 类型化值或 null
    • containsProperty

      public boolean containsProperty(String path)
      Description copied from interface: PropertySource
      Checks if a property exists 检查属性是否存在
      Specified by:
      containsProperty in interface PropertySource
      Parameters:
      path - property path | 属性路径
      Returns:
      true if exists | 如果存在返回 true
    • getPropertyNames

      public Set<String> getPropertyNames()
      Description copied from interface: PropertySource
      Gets all property names 获取所有属性名
      Specified by:
      getPropertyNames in interface PropertySource
      Returns:
      set of property names | 属性名集合
    • getProperties

      public Map<String,Object> getProperties()
      Description copied from interface: PropertySource
      Gets properties as Map 获取属性作为 Map
      Specified by:
      getProperties in interface PropertySource
      Returns:
      property map | 属性映射
    • getProperties

      public Map<String,Object> getProperties(String prefix)
      Description copied from interface: PropertySource
      Gets properties under a prefix 获取前缀下的属性
      Specified by:
      getProperties in interface PropertySource
      Parameters:
      prefix - the prefix | 前缀
      Returns:
      property map under prefix | 前缀下的属性映射