io.github.yezhihao.netmc.util.AdapterList Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of netmc Show documentation
Show all versions of netmc Show documentation
MVC framework based on netty implementation
package io.github.yezhihao.netmc.util;
import java.util.AbstractList;
import java.util.List;
import java.util.function.Function;
/**
* @author yezhihao
* home https://gitee.com/yezhihao/jt808-server
*/
public final class AdapterList extends AbstractList {
private final List src;
private final Function function;
public AdapterList(List src, Function function) {
this.src = src;
this.function = function;
}
@Override
public T get(int index) {
return function.apply(src.get(index));
}
@Override
public int size() {
return src.size();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy