Package space.arim.dazzleconf.reflect
Class MethodYield.ForImplementable
java.lang.Object
space.arim.dazzleconf.reflect.MethodYield.ForImplementable
- All Implemented Interfaces:
AutoCloseable
- Enclosing class:
MethodYield
Builder of return value instructions, given an implementable class. When the caller is finished calling methods
to add return values, they must close this object.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcallDefaultImpl(@NonNull MethodId method) Specifies to invoke the default implementation.voidclose()voidreturnValue(@NonNull MethodId method, @NonNull Object value) Specifies to return the given value.
-
Constructor Details
-
ForImplementable
public ForImplementable()
-
-
Method Details
-
returnValue
Specifies to return the given value. If the given method already has an instruction, it is replaced.If the given method is a covariant override of a method in a parent class, this function should be called twice, with appropriately different
MethodIds.- Parameters:
method- a method within that interfacevalue- the value to return
-
callDefaultImpl
Specifies to invoke the default implementation. If the given method already has an instruction, it is replaced.If the given method exists in the current implementable class but was also overidden by a subclass, this method should be used for both classes.
- Parameters:
method- a method within that interface
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-