- All Implemented Interfaces:
Intern<String>
JDK中默认的字符串规范化实现
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Constructor Summary
Constructors
-
Method Summary
返回指定对象对应的规范化对象,sample对象可能有多个,但是这些对象如果都equals,则返回的是同一个对象
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
StringIntern
public StringIntern()
-
Method Details
-
intern
Description copied from interface: Intern
返回指定对象对应的规范化对象,sample对象可能有多个,但是这些对象如果都equals,则返回的是同一个对象
- Specified by:
intern in interface Intern<String>
- Parameters:
sample - 对象
- Returns:
- 样例对象