Cleanup dependency docs
Some checks failed
Publish to snapshot maven / build (push) Failing after 18s
Some checks failed
Publish to snapshot maven / build (push) Failing after 18s
This commit is contained in:
parent
c6b4185b06
commit
1ef8b24764
|
@ -12,7 +12,7 @@ import org.jetbrains.annotations.Nullable;
|
|||
public interface ModDependencies {
|
||||
|
||||
/**
|
||||
* Get dependencies of a specific mod for a specific type
|
||||
* Get dependencies for a specific type
|
||||
*
|
||||
* @param type the dependency type to query for
|
||||
* @return a collection of dependency entries
|
||||
|
|
|
@ -3,35 +3,11 @@ package dev.frogmc.frogloader.impl.mod;
|
|||
import java.util.*;
|
||||
|
||||
import dev.frogmc.frogloader.api.mod.ModDependencies;
|
||||
import dev.frogmc.frogloader.api.mod.ModProperties;
|
||||
import dev.frogmc.frogloader.api.mod.SemVer;
|
||||
|
||||
/**
|
||||
* A mod's dependencies.
|
||||
*
|
||||
* <p>Mod dependencies are declared in four types:</p>
|
||||
* <code>Type.DEPEND</code>, <code>Type.BREAK</code>, <code>Type.SUGGEST</code> and <code>Type.PROVIDE</code>
|
||||
*
|
||||
* <p>Note: The <code>Type.PROVIDE</code> is a bit of a special case in the way that it only supports a single SemVer version instead of a full version range.</p>
|
||||
*
|
||||
* @see ModDependenciesImpl.Type
|
||||
* @see ModDependenciesImpl.Entry
|
||||
* @see ModProperties
|
||||
* @see SemVer
|
||||
*/
|
||||
public final class ModDependenciesImpl implements ModDependencies {
|
||||
|
||||
private final Map<Type, Collection<ModDependencies.Entry>> entries = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Construct new mod dependencies for a mod.
|
||||
* <p><strong>Internal use only.</strong></p>
|
||||
*
|
||||
* @param depends <code>Type.DEPEND</code> entries
|
||||
* @param breaks <code>Type.BREAK</code> entries
|
||||
* @param suggests <code>Type.SUGGEST</code> entries
|
||||
* @param provides <code>Type.PROVIDE</code> entries
|
||||
*/
|
||||
public ModDependenciesImpl(Collection<ModDependencies.Entry> depends, Collection<ModDependencies.Entry> breaks, Collection<ModDependencies.Entry> suggests, Collection<ModDependencies.Entry> provides) {
|
||||
entries.put(Type.DEPEND, depends);
|
||||
entries.put(Type.BREAK, breaks);
|
||||
|
@ -39,23 +15,11 @@ public final class ModDependenciesImpl implements ModDependencies {
|
|||
entries.put(Type.PROVIDE, provides);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get dependencies of a specific mod for a specific type
|
||||
*
|
||||
* @param type the dependency type to query for
|
||||
* @return a collection of dependency entries
|
||||
*/
|
||||
@Override
|
||||
public Collection<ModDependencies.Entry> getForType(Type type) {
|
||||
return entries.get(type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get entries that depend on a specific mod's id
|
||||
*
|
||||
* @param id the mod id to find dependency entries for
|
||||
* @return a collection of entries that depend on the given mod id
|
||||
*/
|
||||
@Override
|
||||
public Collection<ModDependencies.Entry> getForModId(String id) {
|
||||
List<ModDependencies.Entry> entries = new ArrayList<>();
|
||||
|
|
Loading…
Reference in a new issue