diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..03362d4 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,12 @@ +name: Publish package to the Maven Central Repository + +on: + release: + types: [created] + +jobs: + deploy: + uses: FontysVenlo/alda_api_workflows/.github/workflows/deploy.yml@main + secrets: inherit + with: + tag: ${{ github.event.release.tag_name }} \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index f580c88..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: Publish to Maven Central - -on: - release: - types: [published] - -jobs: - publish: - uses: FontysVenlo/publish-maven-central/.github/workflows/publish.yml@main - with: - tag: ${{ github.event.release.tag_name }} - secrets: inherit \ No newline at end of file diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml new file mode 100644 index 0000000..6a941ca --- /dev/null +++ b/.github/workflows/pullrequest.yml @@ -0,0 +1,9 @@ +name: Java CI with Maven + +on: + pull_request: + branches: [ main ] + +jobs: + build: + uses: FontysVenlo/alda_api_workflows/.github/workflows/pullrequest.yml@main \ No newline at end of file diff --git a/src/main/java/io/github/fontysvenlo/alda/stacks_queues_api/Queue.java b/src/main/java/io/github/fontysvenlo/alda/stacks_queues_api/Queue.java index 7b2bc9c..b91784a 100644 --- a/src/main/java/io/github/fontysvenlo/alda/stacks_queues_api/Queue.java +++ b/src/main/java/io/github/fontysvenlo/alda/stacks_queues_api/Queue.java @@ -7,7 +7,7 @@ */ public interface Queue { /** - * Check if the stack contains any elements + * Check if the stack contains any elements. * * @return true if stack is empty */ diff --git a/src/main/java/io/github/fontysvenlo/alda/stacks_queues_api/Stack.java b/src/main/java/io/github/fontysvenlo/alda/stacks_queues_api/Stack.java index 8ea9dc0..9670453 100644 --- a/src/main/java/io/github/fontysvenlo/alda/stacks_queues_api/Stack.java +++ b/src/main/java/io/github/fontysvenlo/alda/stacks_queues_api/Stack.java @@ -29,7 +29,7 @@ public interface Stack { E peek(); /** - * Check if the stack contains any elements + * Check if the stack contains any elements. * * @return true if stack is empty */ diff --git a/src/main/java/io/github/fontysvenlo/alda/stacks_queues_api/factory/StackQueueConfiguration.java b/src/main/java/io/github/fontysvenlo/alda/stacks_queues_api/factory/StackQueueConfiguration.java index b2b6a18..6d0228c 100644 --- a/src/main/java/io/github/fontysvenlo/alda/stacks_queues_api/factory/StackQueueConfiguration.java +++ b/src/main/java/io/github/fontysvenlo/alda/stacks_queues_api/factory/StackQueueConfiguration.java @@ -3,10 +3,44 @@ import io.github.fontysvenlo.alda.stacks_queues_api.Queue; import io.github.fontysvenlo.alda.stacks_queues_api.Stack; +/** + * Configuration for stacks and queues. + */ public interface StackQueueConfiguration { + /** + * Wether the configuration is active (should be tested). + * @return true if active + */ boolean isActive(); + + /** + * Get the name of the configuration. + * + * @return the name + */ String getName(); + + /** + * For which type is this configuration. + * @return the type + */ StackQueue getType(); + + /** + * Get the stack if a stack configuration. + * + * @param the generic type for the stack + * @return the stack + * @throws NullPointerException if not a stack type + */ Stack getStack(); + + /** + * Get the queue if a queue configuration. + * + * @param the generic type for the queue + * @return the queue + * @throws NullPointerException if not a queue type + */ Queue getQueue(); } diff --git a/src/main/java/io/github/fontysvenlo/alda/stacks_queues_api/factory/StackQueueFactory.java b/src/main/java/io/github/fontysvenlo/alda/stacks_queues_api/factory/StackQueueFactory.java index 540ef7a..61a01a7 100644 --- a/src/main/java/io/github/fontysvenlo/alda/stacks_queues_api/factory/StackQueueFactory.java +++ b/src/main/java/io/github/fontysvenlo/alda/stacks_queues_api/factory/StackQueueFactory.java @@ -2,6 +2,14 @@ import java.util.stream.Stream; +/** + * Factory to get all configurations. + */ public interface StackQueueFactory { + + /** + * Get all the configurations. + * @return Stream of configurations + */ Stream streamConfigurations(); }