Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.codepoetics.octarine.joins;
 
 
public final class RecordJoins {
    private final Stream<? extends Recordlefts;
    public RecordJoins(Stream<? extends Recordlefts) {
        this. = lefts;
    }
    public static RecordJoins join(Collection<? extends Recordlefts) {
        return join(lefts.stream());
    }
    public static RecordJoins join(Stream<? extends Recordlefts) {
        return new RecordJoins(lefts);
    }
    public <K extends Comparable<K>> JoinBuilder<K> on(Key<K> foreignKey) {
        return comparingWith(Comparator.<K>naturalOrder()).on(foreignKey::extract);
    }
    public static interface ComparatorCapture<K> {
        JoinBuilder<K> on(Function<? super Record, ? extends K> foreignKey);
    }
    public <K> ComparatorCapture<K> comparingWith(Comparator<? super K> comparator) {
        return f -> new JoinBuilder<>(comparator, JoinKey.on(fcomparator));
    }
    public static final class JoinBuilder<K> {
        private final Comparator<? super K> comparator;
        private final Stream<? extends Recordlefts;
        private final JoinKey<Record, K> foreignKey;
        private JoinBuilder(Comparator<? super K> comparator,
                            Stream<? extends Recordlefts,
                            JoinKey<Record, K> foreignKey) {
            this. = comparator;
            this. = lefts;
            this. = foreignKey;
        }
        public RecordJoiner<K> to(Key<? extends K> primaryKey) {
            return new RecordJoiner<K>(.index(), JoinKey.<Record, K>on(primaryKey::extract));
        }
    }
New to GrepCode? Check out our FAQ X