Class Lookups<V>

java.lang.Object
org.aoju.bus.core.text.Lookups<V>

public abstract class Lookups<V> extends Object
查找字符串值的字符串键
Since:
Java 17+
Author:
Kimi Liu
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract String
    查找字符串值的字符串键
    static <V> Lookups<V>
    返回使用映射查找值的查找 如果映射为null,那么每次查找都会返回null 使用toString()将映射结果对象转换为字符串
    static Lookups<String>
    返回一个新的查找,该查找使用当前的副本 如果安全管理器阻塞了对系统属性的访问, 则null将阻塞每次查找都返回

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Lookups

      protected Lookups()
  • Method Details

    • systemPropertiesLookup

      public static Lookups<String> systemPropertiesLookup()
      返回一个新的查找,该查找使用当前的副本 如果安全管理器阻塞了对系统属性的访问, 则null将阻塞每次查找都返回
      Returns:
      使用系统属性返回查找, 而不是null
    • mapLookup

      public static <V> Lookups<V> mapLookup(Map<String,V> map)
      返回使用映射查找值的查找 如果映射为null,那么每次查找都会返回null 使用toString()将映射结果对象转换为字符串
      Type Parameters:
      V - 查找支持的值的类型
      Parameters:
      map - 映射键值的映射,可以为空
      Returns:
      使用映射的查找, 而不是null
    • lookup

      public abstract String lookup(String key)
      查找字符串值的字符串键
      Parameters:
      key - 要查找的键可以为空
      Returns:
      匹配值, 如果没有匹配则为空