Interface PropertySource

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface PropertySource
配置文件源
Since:
Java 17+
Author:
Kimi Liu
  • Method Details

    • props

      Properties props()
      获取属性集合
      Returns:
      属性集合
    • getProperty

      default String getProperty(String key)
      获取属性
      Parameters:
      key - 属性键值
      Returns:
      属性值
    • getProperty

      default String getProperty(String key, String defaultValue)
      获取属性,可设置默认值
      Parameters:
      key - 属性键值
      defaultValue - 默认值
      Returns:
      属性值
    • getPlaceholderProperty

      default String getPlaceholderProperty(String placeholder)
      获取占位符属性
      Parameters:
      placeholder - 占位 eg. ${a}
      Returns:
      属性值
    • containPrefix

      default boolean containPrefix(String prefix)
      是否包含该前缀属性
      Parameters:
      prefix - 前缀
      Returns:
      true包含