MCPcopy
hub / github.com/Col-E/Recaf / ofType

Method ofType

src/main/java/me/coley/recaf/plugin/PluginsManager.java:147–154  ·  view source on GitHub ↗

Fetch the active plugins matching the given type. This will exclude plugins that are disabled. @param type Class of plugin. @param Plugin type. @return Collection of active plugins matching the given type.

(Class<T> type)

Source from the content-addressed store, hash-verified

145 * @return Collection of active plugins matching the given type.
146 */
147 @SuppressWarnings("unchecked")
148 public <T extends BasePlugin> Collection<T> ofType(Class<T> type) {
149 return plugins().values().stream()
150 .filter(plugin -> type.isAssignableFrom(plugin.getClass()))
151 .filter(plugin -> pluginStates.getOrDefault(plugin.getName(), false))
152 .map(plugin -> (T) plugin)
153 .collect(Collectors.toList());
154 }
155
156 /**
157 * @return Plugins manager instance.

Callers 15

loadPluginsMethod · 0.95
writeArchiveMethod · 0.95
acceptMethod · 0.80
setWorkspaceMethod · 0.80
runMethod · 0.80
setupMethod · 0.80
exitMethod · 0.80
openMethod · 0.80
setupMethod · 0.80
handleAddClassMethod · 0.80
onFileMethod · 0.80
finishClassesMethod · 0.80

Calls 5

pluginsMethod · 0.95
valuesMethod · 0.80
getClassMethod · 0.80
getNameMethod · 0.65
mapMethod · 0.45

Tested by

no test coverage detected