Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.codepoetics.octarine.joins;
 
 
 import java.util.Set;
public final class RecordJoiner<K> {
    private final Index<K, RecordleftIndex;
    private final JoinKey<Record, K> primaryKey;
    public RecordJoiner(Index<K, RecordleftIndexJoinKey<Record, K> primaryKey) {
        this. = leftIndex;
        this. = primaryKey;
    }
    // Many to one
    public Stream<RecordmanyToOne(Collection<? extends Recordrights) {
        return manyToOne(rights.stream());
    }
    public Stream<RecordmanyToOne(Fetcher<K, Recordfetcher) {
        return manyToOne(fetcher.fetch(.keys()));
    }
    public Stream<RecordmanyToOne(Stream<? extends Recordrights) {
        return .manyToOne(.index(rights)).map(recordIntoRecord());
    }
    // Strict many to one
    public Stream<RecordstrictManyToOne(Collection<? extends Recordrights) {
        return strictManyToOne(rights.stream());
    }
    public Stream<RecordstrictManyToOne(Fetcher<K, Recordfetcher) {
        return strictManyToOne(fetcher.fetch(.keys()));
    }
    public Stream<RecordstrictManyToOne(Stream<? extends Recordrights) {
        return .strictManyToOne(.index(rights)).map(recordIntoRecord());
    }
    // One to many
    public Stream<RecordoneToMany(Collection<? extends RecordrightsListKey<RecordmanyKey) {
        return oneToMany(rights.stream(), manyKey);
    }
    public Stream<RecordoneToMany(Fetcher<K, RecordfetcherListKey<RecordmanyKey) {
        return oneToMany(fetcher.fetch(.keys()), manyKey);
    }
    public Stream<RecordoneToMany(Stream<? extends RecordrightsListKey<RecordmanyKey) {
        return .oneToMany(.index(rights)).map(recordsIntoRecord(manyKey));
    }
    // Strict one to many
    public Stream<RecordstrictOneToMany(Collection<? extends RecordrightsListKey<RecordmanyKey) {
        return strictOneToMany(rights.stream(), manyKey);
    }
    public Stream<RecordstrictOneToMany(Fetcher<K, RecordfetcherListKey<RecordmanyKey) {
        return strictOneToMany(fetcher.fetch(.keys()), manyKey);
    }
    public Stream<RecordstrictOneToMany(Stream<? extends RecordrightsListKey<RecordmanyKey) {
        return .strictOneToMany(.index(rights)).map(recordsIntoRecord(manyKey));
    }
    // Strict one to one
    public Stream<RecordstrictOneToOne(Collection<? extends Recordrights) {
        return strictOneToOne(rights.stream());
    }
    public Stream<RecordstrictOneToOne(Fetcher<K, Recordfetcher) {
        return strictOneToOne(fetcher.fetch(.keys()));
    }
    public Stream<RecordstrictOneToOne(Stream<? extends Recordrights) {
        return .strictOneToOne(.index(rights)).map(recordIntoRecord());
    }
    private Function<T2<RecordRecord>, RecordrecordIntoRecord() {
        return t -> t.sendTo(Record::with);
    }
    private Function<T2<RecordSet<Record>>, RecordrecordsIntoRecord(ListKey<Recordkey) {
        return t -> t.sendTo((fs) -> f.with(key.of(s)));
    }
New to GrepCode? Check out our FAQ X