io.github.amayaframework.di.stub.Mapping Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of amaya-di Show documentation
Show all versions of amaya-di Show documentation
A framework responsible for monitoring and automating the dependency injection process.
package io.github.amayaframework.di.stub;
import io.github.amayaframework.di.Artifact;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
final class Mapping {
final Map artifacts;
final Map fields;
final String[] order;
private Mapping(Map artifacts, Map fields, String[] order) {
this.artifacts = artifacts;
this.fields = fields;
this.order = order;
}
static Mapping of(Set artifacts) {
var from = new HashMap();
var to = new HashMap();
var order = new String[artifacts.size()];
var count = 0;
for (var artifact : artifacts) {
var field = Integer.toString(count);
from.put(artifact, field);
to.put(field, artifact);
order[count] = field;
++count;
}
return new Mapping(from, to, order);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy