org.babyfish.jimmer.client.source.AbstractSource Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jimmer-client Show documentation
Show all versions of jimmer-client Show documentation
A revolutionary ORM framework for both java and kotlin
package org.babyfish.jimmer.client.source;
import org.babyfish.jimmer.client.generator.Render;
import java.util.*;
import java.util.function.Supplier;
abstract class AbstractSource implements Source {
private final Render render;
private Map subSourceMap;
AbstractSource(Render render) {
this.render = Objects.requireNonNull(render, "render cannot be null");
}
@Override
public Source subSource(String name, Supplier renderCreator) {
Map subSourceMap = this.subSourceMap;
if (subSourceMap == null) {
this.subSourceMap = subSourceMap = new TreeMap<>();
}
Source subSource = subSourceMap.get(name);
if (subSource == null) {
subSource = new SubSource(name, renderCreator.get());
subSourceMap.put(name, subSource);
}
return subSource;
}
@Override
public Collection