forked from StarOpenSource/Engine
Fix Javadoc issues
This commit is contained in:
parent
eb108495ea
commit
03d53fc997
5 changed files with 106 additions and 4 deletions
|
@ -22,7 +22,6 @@ package de.staropensource.sosengine.base.classes;
|
|||
import de.staropensource.sosengine.base.Engine;
|
||||
import de.staropensource.sosengine.base.annotations.EngineSubsystem;
|
||||
import de.staropensource.sosengine.base.annotations.EventListener;
|
||||
import de.staropensource.sosengine.base.exceptions.versioning.InvalidVersionStringException;
|
||||
import de.staropensource.sosengine.base.internal.events.InternalEngineShutdownEvent;
|
||||
import de.staropensource.sosengine.base.logging.LoggerInstance;
|
||||
import de.staropensource.sosengine.base.types.DependencyVector;
|
||||
|
@ -71,10 +70,11 @@ public abstract class SubsystemClass {
|
|||
* Used for dependency resolution during startup.
|
||||
*
|
||||
* @return matching {@link DependencyVector} for the subsystem
|
||||
* @throws IllegalStateException when building the DependencyVector fails, see {@link DependencyVector.Builder#build()}
|
||||
* @see DependencyVector
|
||||
* @since v1-alpha1
|
||||
* @since v1-alpha4
|
||||
*/
|
||||
public abstract @NotNull DependencyVector getDependencyVector() throws InvalidVersionStringException;
|
||||
public abstract @NotNull DependencyVector getDependencyVector() throws IllegalStateException;
|
||||
|
||||
/**
|
||||
* Called on engine shutdown.
|
||||
|
|
|
@ -83,6 +83,13 @@ public final class DependencySubsystemVector extends DependencyVector {
|
|||
* @since v1-alpha4
|
||||
*/
|
||||
public static final class Builder extends DependencyVector.Builder {
|
||||
/**
|
||||
* Constructs this class.
|
||||
*
|
||||
* @since v1-alpha4
|
||||
*/
|
||||
public Builder() {}
|
||||
|
||||
/**
|
||||
* Contains the {@link SubsystemClass} to associate.
|
||||
*
|
||||
|
@ -129,5 +136,29 @@ public final class DependencySubsystemVector extends DependencyVector {
|
|||
if (mainClass == null)
|
||||
throw new IllegalStateException("The main class is unset");
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the {@link SubsystemClass} to associate.
|
||||
*
|
||||
* @return {@link SubsystemClass} to associcate
|
||||
* @see DependencySubsystemVector#mainClass
|
||||
* @since v1-alpha4
|
||||
*/
|
||||
public @Nullable SubsystemClass getMainClass() {
|
||||
return mainClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the {@link SubsystemClass} to associate.
|
||||
*
|
||||
* @param mainClass new {@link SubsystemClass} to associate
|
||||
* @return builder instance
|
||||
* @see DependencySubsystemVector#mainClass
|
||||
* @since v1-alpha4
|
||||
*/
|
||||
public @NotNull DependencyVector.Builder setIdentifier(@Nullable SubsystemClass mainClass) {
|
||||
this.mainClass = mainClass;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,6 +31,13 @@ import org.jetbrains.annotations.Nullable;
|
|||
* @since v1-alpha4
|
||||
*/
|
||||
public class QuietLoggerImplementation implements LoggerImplementation {
|
||||
/**
|
||||
* Constructs this class.
|
||||
*
|
||||
* @since v1-alpha4
|
||||
*/
|
||||
public QuietLoggerImplementation() {}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public @Nullable String prePlaceholder(@NotNull LogLevel level, @NotNull Class<?> issuerClass, @NotNull String issuerOrigin, @Nullable String issuerMetadata, @NotNull String message, @NotNull String format) {
|
||||
|
|
|
@ -174,7 +174,7 @@ public class DependencyVector {
|
|||
* Builds a new {@link DependencyVector} instance.
|
||||
*
|
||||
* @return new {@link DependencyVector}
|
||||
* @throws IllegalStateException if the identifier, versioning system or version is unset
|
||||
* @throws IllegalStateException when the identifier, versioning system or version is unset or the version string is invalid
|
||||
* @since v1-alpha4
|
||||
*/
|
||||
public @NotNull DependencyVector build() throws IllegalStateException {
|
||||
|
@ -285,6 +285,7 @@ public class DependencyVector {
|
|||
* Sets the identifier of the new vector.
|
||||
*
|
||||
* @param identifier new identifier
|
||||
* @return builder instance
|
||||
* @see DependencyVector#identifier
|
||||
* @since v1-alpha4
|
||||
*/
|
||||
|
@ -297,6 +298,7 @@ public class DependencyVector {
|
|||
* Sets the versioning system the new vector should use.
|
||||
*
|
||||
* @param versioningSystem versioning system to use
|
||||
* @return builder instance
|
||||
* @see DependencyVector#versioningSystem
|
||||
* @since v1-alpha4
|
||||
*/
|
||||
|
@ -309,6 +311,7 @@ public class DependencyVector {
|
|||
* Sets the version of the new vector.
|
||||
*
|
||||
* @param version vector version
|
||||
* @return builder instance
|
||||
* @see DependencyVector#version
|
||||
* @since v1-alpha4
|
||||
*/
|
||||
|
@ -321,6 +324,7 @@ public class DependencyVector {
|
|||
* Sets a set of all identifiers and their versions the new vector should depend on.
|
||||
*
|
||||
* @param dependencies dependencies
|
||||
* @return builder instance
|
||||
* @see DependencyVector#dependencies
|
||||
* @since v1-alpha4
|
||||
*/
|
||||
|
@ -333,6 +337,7 @@ public class DependencyVector {
|
|||
* Sets a set of all identifiers and their versions the new vector should provide.
|
||||
*
|
||||
* @param provides provided vectors
|
||||
* @return builder instance
|
||||
* @see DependencyVector#provides
|
||||
* @since v1-alpha4
|
||||
*/
|
||||
|
|
|
@ -21,9 +21,12 @@ package de.staropensource.sosengine.testapp;
|
|||
|
||||
import de.staropensource.sosengine.base.Engine;
|
||||
import de.staropensource.sosengine.base.annotations.EventListener;
|
||||
import de.staropensource.sosengine.base.data.versioning.OneNumberVersioningSystem;
|
||||
import de.staropensource.sosengine.base.events.ThrowableCatchEvent;
|
||||
import de.staropensource.sosengine.base.logging.LoggerInstance;
|
||||
import de.staropensource.sosengine.base.types.DependencyVector;
|
||||
import de.staropensource.sosengine.base.types.vectors.Vec2i;
|
||||
import de.staropensource.sosengine.base.utility.DependencyResolver;
|
||||
import de.staropensource.sosengine.base.utility.Miscellaneous;
|
||||
import de.staropensource.sosengine.base.utility.parser.StackTraceParser;
|
||||
import de.staropensource.sosengine.graphics.GraphicsSubsystem;
|
||||
|
@ -38,7 +41,9 @@ import lombok.SneakyThrows;
|
|||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* The main class of the sos!engine development application.
|
||||
|
@ -124,6 +129,60 @@ public final class Main {
|
|||
// Say hello to the world!
|
||||
logger.info("Hello world!");
|
||||
|
||||
// DependencyResolver test
|
||||
DependencyResolver resolver = new DependencyResolver();
|
||||
|
||||
Set<@NotNull String> depsT1 = new HashSet<>();
|
||||
Set<@NotNull String> provT1 = new HashSet<>();
|
||||
Set<@NotNull String> depsT2 = new HashSet<>();
|
||||
Set<@NotNull String> provT2 = new HashSet<>();
|
||||
Set<@NotNull String> depsT3 = new HashSet<>();
|
||||
Set<@NotNull String> provT3 = new HashSet<>();
|
||||
Set<@NotNull String> depsT4 = new HashSet<>();
|
||||
Set<@NotNull String> provT4 = new HashSet<>();
|
||||
|
||||
depsT2.add("test1=5");
|
||||
provT3.add("test5=11");
|
||||
depsT4.add("test3>100<10");
|
||||
|
||||
resolver.addVectors(new DependencyVector[]{
|
||||
new DependencyVector.Builder()
|
||||
.setIdentifier("test1")
|
||||
.setVersioningSystem(OneNumberVersioningSystem.class)
|
||||
.setVersion("5")
|
||||
.setDependencies(depsT1)
|
||||
.setProvides(provT1)
|
||||
.build(),
|
||||
new DependencyVector.Builder()
|
||||
.setIdentifier("test2")
|
||||
.setVersioningSystem(OneNumberVersioningSystem.class)
|
||||
.setVersion("1")
|
||||
.setDependencies(depsT2)
|
||||
.setProvides(provT2)
|
||||
.build(),
|
||||
new DependencyVector.Builder()
|
||||
.setIdentifier("test3")
|
||||
.setVersioningSystem(OneNumberVersioningSystem.class)
|
||||
.setVersion("106")
|
||||
.setDependencies(depsT3)
|
||||
.setProvides(provT3)
|
||||
.build(),
|
||||
new DependencyVector.Builder()
|
||||
.setIdentifier("test4")
|
||||
.setVersioningSystem(OneNumberVersioningSystem.class)
|
||||
.setVersion("69")
|
||||
.setDependencies(depsT4)
|
||||
.setProvides(provT4)
|
||||
.build()
|
||||
});
|
||||
|
||||
try {
|
||||
resolver.resolve();
|
||||
} catch (Exception exception) {
|
||||
logger.crash("Test resolution failed", exception);
|
||||
}
|
||||
logger.warn("Test resolution succeeded");
|
||||
|
||||
// Choose Graphics API to use
|
||||
if (!GraphicsSubsystem.getInstance().setGraphicsApi())
|
||||
logger.crash("No Graphics API is compatible");
|
||||
|
|
Loading…
Reference in a new issue