use of com.eden.orchid.api.server.admin.AdminList in project Orchid by JavaEden.
the class OrchidModule method bindKnownSet.
private void bindKnownSet(final Class<?> setClass) {
Provider<OrchidContext> contextProvider = getProvider(OrchidContext.class);
if (!knownSets.contains(setClass)) {
Multibinder<AdminList> binder = Multibinder.newSetBinder(binder(), AdminList.class);
binder.addBinding().toInstance(new AdminList() {
@Override
public Class<?> getListClass() {
return setClass;
}
@Override
public String getKey() {
return setClass.getSimpleName();
}
@Override
public Collection<Class<?>> getItems() {
return contextProvider.get().resolveSet(setClass).stream().map(Object::getClass).collect(Collectors.toList());
}
@Override
public boolean isImportantType() {
return setClass.isAnnotationPresent(ImportantModularType.class);
}
});
knownSets.add(setClass);
}
}
Aggregations