co.unruly.control.LinkList.ConcatList Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of org.apache.karaf.jaas.command Show documentation
Show all versions of org.apache.karaf.jaas.command Show documentation
This bundle provides Karaf shell commands to manipulate JAAS security framework.
package co.unruly.control.LinkList;
import java.util.function.BiFunction;
import java.util.function.Supplier;
public class ConcatList implements LinkList {
private final LinkList first;
private final LinkList second;
public ConcatList(LinkList first, LinkList second) {
this.first = first;
this.second = second;
}
@Override
public R read(BiFunction, R> onPresent, Supplier onEmpty) {
return first.read(
(t, ts) -> onPresent.apply(t, new ConcatList<>(ts, second)),
() -> second.read(onPresent, onEmpty)
);
}
@Override
public String toString() {
return read(
(x, xs) -> "cons(" + x.toString() + ", " + xs.toString() + ")",
() -> "nil"
);
}
}
© 2015 - 2026 Weber Informatics LLC | Privacy Policy