Compare commits

..

No commits in common. "5766072fd72afd3b5f65a0b1bdc859ef478ff436" and "f96584ccd96a62d67121d2e2d5ded202fa9a8dd9" have entirely different histories.

14 changed files with 27 additions and 38 deletions

View file

@ -6,13 +6,17 @@
*/
module sosengine.ansi {
// Dependencies
// -> Java
// -> Java <-
requires transitive java.management;
// -> Engine
// -> Engine <-
requires transitive sosengine.base;
// -> Libraries
// -> Common stuff <-
requires transitive static lombok;
requires transitive org.jetbrains.annotations;
// -> Subystem-specific dependencies <-
requires org.fusesource.jansi;
// API access

View file

@ -56,7 +56,7 @@ public final class StacktraceAll implements Placeholder {
.append(" priority=")
.append(thread.getPriority())
.append(" group=")
.append(thread.getThreadGroup() == null ? "<unknown>" : thread.getThreadGroup().getName())
.append(thread.getThreadGroup().getName())
.append(" state=")
.append(thread.getState().name())
.append(" daemon=")

View file

@ -238,8 +238,8 @@ public final class LoggerInstance {
/**
* Builds a new {@link LoggerInstance} instance.
*
* @return new {@link LoggerInstance} instance
* @throws IllegalStateException if {@link #clazz} is unset
* @return new {@link LoggerInstance}
* @throws IllegalStateException if the class or origin is unset
* @since v1-alpha2
*/
public LoggerInstance build() throws IllegalStateException {
@ -294,7 +294,6 @@ public final class LoggerInstance {
*
* @param clazz new class of the issuer
* @return builder instance
* @see LoggerInstance#clazz
* @since v1-alpha2
*/
public @NotNull Builder setClazz(@Nullable Class<?> clazz) {
@ -307,7 +306,6 @@ public final class LoggerInstance {
*
* @param origin new origin of the issuer
* @return builder instance
* @see LoggerInstance#origin
* @since v1-alpha2
*/
public @NotNull Builder setOrigin(@Nullable String origin) {
@ -320,7 +318,6 @@ public final class LoggerInstance {
*
* @param metadata new metadata about the issuer
* @return builder instance
* @see LoggerInstance#metadata
* @since v1-alpha2
*/
public @NotNull Builder setMetadata(@Nullable String metadata) {

View file

@ -173,8 +173,8 @@ public class DependencyVector {
/**
* Builds a new {@link DependencyVector} instance.
*
* @return new {@link DependencyVector} instance
* @throws IllegalStateException if {@link #identifier}, {@link #versioningSystem} or {@link #version} is unset or the version string is invalid
* @return new {@link DependencyVector}
* @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 {

View file

@ -20,6 +20,7 @@
package de.staropensource.sosengine.base.type;
import de.staropensource.sosengine.base.exception.TristateConversionException;
import org.jetbrains.annotations.NotNull;
/**
* Just a {@link Boolean}, but it can be {@link #UNSET}.
@ -49,15 +50,16 @@ public enum Tristate {
FALSE;
/**
* Converts the {@link Tristate} into a {@link Boolean}.
* Converts a {@link Tristate} into a {@link Boolean}.
* Make sure to check for {@link #UNSET} first.
*
* @param tristate {@link Tristate} to convert
* @return booleanized {@link Tristate}
* @throws TristateConversionException when encountering {@link #UNSET}
* @since v1-alpha2
*/
public boolean toBoolean() {
return switch (this) {
public static boolean toBoolean(@NotNull Tristate tristate) {
return switch (tristate) {
case UNSET -> throw new TristateConversionException();
case TRUE -> true;
case FALSE -> false;

View file

@ -80,7 +80,7 @@ public final class Miscellaneous {
* @since v1-alpha2
*/
public static boolean getBooleanizedInteger(@Range(from = 0, to = 1) int integer) throws TristateConversionException {
return getTristatedInteger(integer).toBoolean();
return Tristate.toBoolean(getTristatedInteger(integer));
}
/**

View file

@ -5,9 +5,7 @@
*/
module sosengine.base {
// Dependencies
// -> Java
requires transitive java.management;
// -> Dependencies
requires transitive static lombok;
requires transitive org.jetbrains.annotations;
requires org.reflections;

View file

@ -6,7 +6,7 @@
*/
module sosengine.slf4j_compat {
// Dependencies
// -> Engine
// -> Subsystems
requires transitive sosengine.base;
// -> Libraries
requires transitive static lombok;

View file

@ -6,8 +6,10 @@
*/
open module sosengine.testapp {
// Dependencies
// -> Engine
// -> Subsystems
requires sosengine.base;
requires sosengine.windowing;
requires sosengine.slf4j_compat;
// -> Libraries
requires static lombok;
}

View file

@ -5,7 +5,7 @@
*/
module sosengine.testing {
// Dependencies
// -> Engine
// -> Subsystems
requires transitive sosengine.base;
// -> Libraries
requires transitive static lombok;

View file

@ -328,7 +328,7 @@ public class GlfwWindow extends Window {
if (isTerminated())
return false;
return Miscellaneous.getTristatedInteger(glfwGetWindowAttrib(identifierLong, GLFW_FOCUSED)).toBoolean();
return Tristate.toBoolean(Miscellaneous.getTristatedInteger(glfwGetWindowAttrib(identifierLong, GLFW_FOCUSED)));
}
/** {@inheritDoc} */

View file

@ -8,7 +8,7 @@ import de.staropensource.sosengine.windowing.implementable.Window;
*/
module sosengine.windowing.glfw {
// Dependencies
// -> Engine
// -> Subsystems
requires transitive sosengine.base;
requires transitive sosengine.windowing;
// -> Libraries

View file

@ -736,7 +736,7 @@ public abstract class Window implements AutoCloseable {
/**
* Builds a new {@link Window} instance.
*
* @throws IllegalStateException if {@link #title}, {@link #size} or {@link #position} is unset
* @throws IllegalStateException if the window title, size or position is unset
* @throws Exception thrown when creating a new {@link Window} instance fails
* @return {@link Window} instance
* @since v1-alpha2
@ -949,7 +949,6 @@ public abstract class Window implements AutoCloseable {
*
* @param name new window name
* @return builder instance
* @see Window#name
* @since v1-alpha2
*/
public @NotNull Builder setName(@Nullable String name) {
@ -962,7 +961,6 @@ public abstract class Window implements AutoCloseable {
*
* @param title new window title
* @return builder instance
* @see Window#title
* @since v1-alpha2
*/
public @NotNull Builder setTitle(@Nullable String title) {
@ -975,7 +973,6 @@ public abstract class Window implements AutoCloseable {
*
* @param size new window size
* @return builder instance
* @see Window#size
* @since v1-alpha2
*/
public @NotNull Builder setSize(@Nullable Vec2i size) {
@ -988,7 +985,6 @@ public abstract class Window implements AutoCloseable {
*
* @param minimumSize new minimum window size
* @return builder instance
* @see Window#minimumSize
* @since v1-alpha2
*/
public @NotNull Builder setMinimumSize(@Nullable Vec2i minimumSize) {
@ -1001,7 +997,6 @@ public abstract class Window implements AutoCloseable {
*
* @param maximumSize new maximum window size
* @return builder instance
* @see Window#maximumSize
* @since v1-alpha2
*/
public @NotNull Builder setMaximumSize(@Nullable Vec2i maximumSize) {
@ -1014,7 +1009,6 @@ public abstract class Window implements AutoCloseable {
*
* @param position new window position
* @return builder instance
* @see Window#position
* @since v1-alpha2
*/
public @NotNull Builder setPosition(@Nullable Vec2i position) {
@ -1027,7 +1021,6 @@ public abstract class Window implements AutoCloseable {
*
* @param windowMode new window mode
* @return builder instance
* @see Window#windowMode
* @since v1-alpha2
*/
public @NotNull Builder setWindowMode(@Nullable WindowMode windowMode) {
@ -1040,7 +1033,6 @@ public abstract class Window implements AutoCloseable {
*
* @param monitor new target monitor
* @return builder instance
* @see Window#monitor
* @since v1-alpha2
*/
private synchronized @NotNull Builder setMonitor(@Nullable Monitor monitor) {
@ -1053,7 +1045,6 @@ public abstract class Window implements AutoCloseable {
*
* @param resizable new resizable flag state
* @return builder instance
* @see Window#resizable
* @since v1-alpha2
*/
public @NotNull Builder setResizable(@NotNull Tristate resizable) {
@ -1066,7 +1057,6 @@ public abstract class Window implements AutoCloseable {
*
* @param borderless new borderless flag state
* @return builder instance
* @see Window#borderless
* @since v1-alpha2
*/
public @NotNull Builder setBorderless(@NotNull Tristate borderless) {
@ -1079,7 +1069,6 @@ public abstract class Window implements AutoCloseable {
*
* @param focusable new focusable flag state
* @return builder instance
* @see Window#focusable
* @since v1-alpha2
*/
public @NotNull Builder setFocusable(@NotNull Tristate focusable) {
@ -1092,7 +1081,6 @@ public abstract class Window implements AutoCloseable {
*
* @param onTop new on top flag state
* @return builder instance
* @see Window#onTop
* @since v1-alpha2
*/
public @NotNull Builder setOnTop(@NotNull Tristate onTop) {
@ -1105,7 +1093,6 @@ public abstract class Window implements AutoCloseable {
*
* @param transparent new transparency flag state
* @return builder instance
* @see Window#transparent
* @since v1-alpha2
*/
public @NotNull Builder setTransparent(@NotNull Tristate transparent) {
@ -1118,7 +1105,6 @@ public abstract class Window implements AutoCloseable {
*
* @param rendering new rendering flag state
* @return builder instance
* @see Window#rendering
* @since v1-alpha2
*/
public @NotNull Builder setRendering(@NotNull Tristate rendering) {

View file

@ -6,7 +6,7 @@
*/
module sosengine.windowing {
// Dependencies
// -> Engine
// -> Subsystems
requires transitive sosengine.base;
// -> Libraries
requires transitive static lombok;