jnr.ffi.mapper.CompositeFunctionMapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jnr-unixsocket-nodep Show documentation
Show all versions of jnr-unixsocket-nodep Show documentation
com.github.jnr:jnr-unixsocket with orh.objectweb.asm shaded
The newest version!
package jnr.ffi.mapper;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
/**
*
*/
public final class CompositeFunctionMapper implements FunctionMapper {
private final Collection functionMappers;
public CompositeFunctionMapper(Collection functionMappers) {
this.functionMappers = Collections.unmodifiableList(new ArrayList(functionMappers));
}
@Override
public String mapFunctionName(String functionName, Context context) {
for (FunctionMapper functionMapper : functionMappers) {
String mappedName = functionMapper.mapFunctionName(functionName, context);
if (mappedName != null) {
return mappedName;
}
}
return null;
}
}