Package proguard.evaluation
Interface ValueCalculator
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
This functional interface can be used to specify a way of creating
Values given a series
of parameters.
For now this is split from ValueFactory and the function can
be implemented in a way that all the calls to the specific value factory methods go through the
same function. It could be argued that instead of having a functional interface this could be a
new method in ValueFactory, but until something like this is
needed in different location having a separate function looks cleaner.
-
Method Details
-
apply
Value apply(@NotNull @NotNull String type, @Nullable @Nullable Clazz referencedClass, boolean isParticular, @Nullable @Nullable Object concreteValue, boolean valueMayBeExtension, @Nullable @Nullable Object valueId) Create aValuegiven all available known information about it (included the actual tracked value or aModelof it, if available, and its reference identifier if the value has the same reference as an existing one).This method is not limited to particular value and can be used to create any value given the available amount of information.
- Parameters:
type- the static type of the created value (runtime type might implement/extend it).referencedClass- theClazzof the value (if it's a reference value).isParticular- whether the value to create is particular. If not the `concreteValue` parameter will be ignored.concreteValue- the value of the tracked object. Can be the actual value or aModel.valueMayBeExtension- whether the created value might actually be an extension of the type. This should always be false for the instance created by constructors since they always create an object of the exact type. This should usually beClassUtil.isExtendable(Clazz)for non constructor calls or more precise information if the caller is able to provide it.valueId- the already known reference identifier of the created value. Null if the identifier was not previously known. This is particularly important for constructors, since they always return void and the only way to associate the constructed object to its existing references is via the valueId.- Returns:
- The
Valuecorresponding to the given parameters.
-