使用这个Mapbox doc作为引用:
lineOpacity(Function<T,Float> function)
The opacity at which the line will be drawn.
什么参数会lineOpacity()
接受吗?
有人可以向我展示传递给该函数的参数的示例吗?
最佳答案
public static <T> PropertyValue<Function<T,Float>> lineOpacity(Function<T,Float> function)
The opacity at which the line will be drawn.
Type Parameters: T - the function input type
Parameters: function - a wrapper function for Float
Returns: property wrapper around a Float function
这完全是他们的文档所述。如前所述Function
class 是 Float 的包装函数。 lineOpacity
方法将返回 Type T
这将被传递到 function
我喜欢将其视为 HashMap<T,M>
哪里T - the key, let's say String
和M - the value, let's say Integer
您要求提供示例
lineOpacity(new Function<String, Float>()) // will return a String
关于java - Android 中的 Class<T, String> 类型是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59085375/