- All Implemented Interfaces:
Provider
- Direct Known Subclasses:
NullProvider
总是返回相同的对象
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Constructor Summary
Constructors
-
Method Summary
返回对象,如果在构造/查找对象时出现任何问题,实现类应该抛出异常
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
AlwaysProvider
public AlwaysProvider(Object constant)
-
Method Details
-
getObject
Description copied from interface: Provider
返回对象,如果在构造/查找对象时出现任何问题,实现类应该抛出异常
- Specified by:
getObject in interface Provider
- Returns:
- 调用方法的对象