
@Retention(value=RUNTIME) @Target(value=ANNOTATION_TYPE) public @interface BridgeMethodMapping
public interface Generic<K, V> {
void set(K key, V value);
V get(K key);
void put(K key, V value, boolean overwrite);
}
@BridgeMethodMappings({
@BridgeMethodMapping(methodName = "set", erasedParamTypes = { Object.class, Object.class }, targetParamTypes = { Number.class,
String.class }),
@BridgeMethodMapping(methodName = "get", erasedParamTypes = { Object.class }, targetParamTypes = { Number.class }),
@BridgeMethodMapping(methodName = "put", erasedParamTypes = { Object.class, Object.class, boolean.class }, targetParamTypes = {
Number.class, String.class, boolean.class }) })
public class SubGeneric implements Generic<Number, String> {
public void set(Number key, String value) {
.....
}
public String get(Number key) {
....
}
public void put(Number key, String value, boolean overwrite) {
....
}
}
| Modifier and Type | Required Element and Description |
|---|---|
Class<?>[] |
erasedParamTypes |
String |
methodName |
Class<?>[] |
targetParamTypes |
public abstract String methodName
public abstract Class<?>[] erasedParamTypes
public abstract Class<?>[] targetParamTypes
Copyright © 2019. All rights reserved.