All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.jayield.rapper.mapper.externals.Foreign Maven / Gradle / Ivy

There is a newer version: 1.0.5
Show newest version
package com.github.jayield.rapper.mapper.externals;

import com.github.jayield.rapper.DomainObject;
import com.github.jayield.rapper.unitofwork.UnitOfWork;

import java.util.concurrent.CompletableFuture;
import java.util.function.Function;
import java.util.function.Supplier;

public class Foreign, K> {
    private final K foreignKey;
    private final Function> foreignFunction;

    public Foreign(K foreignKey, Function> foreignFunction) {
        this.foreignKey = foreignKey;
        this.foreignFunction = foreignFunction;
    }

    public K getForeignKey() {
        return foreignKey;
    }

    public CompletableFuture getForeignObject(UnitOfWork unit) {
        return foreignFunction.apply(unit);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy