Skip to content

Commit

Permalink
Initial javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
Rubenicos committed Jan 22, 2024
1 parent 6321bf8 commit 0dfdb60
Show file tree
Hide file tree
Showing 32 changed files with 1,975 additions and 20 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/javadoc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Deploy Javadoc

on: [workflow_dispatch]

jobs:
javadoc:
if: ${{ github.repository_owner == 'saicone' }}

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: actions/setup-java@v3
with:
distribution: adopt
java-version: 11

- name: Build javadoc with Gradle
run: gradle allJavadoc
shell: bash

- name: Deploy javadoc to Github repository
uses: JamesIves/[email protected]
with:
folder: build/docs/all-javadoc
ssh-key: ${{ secrets.JAVADOC_DEPLOY_KEY }}
git-config-name: github-actions[bot]
git-config-email: 41898282+github-actions[bot]@users.noreply.github.com
repository-name: saicone/javadoc
branch: gh-pages
target-folder: settings
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
<img src="https://img.shields.io/discord/974288218839191612.svg?style=flat-square&label=discord&logo=discord&logoColor=white&color=7289da"/>
</a>
<a href="https://www.codefactor.io/repository/github/saicone/settings">
<img src="https://www.codefactor.io/repository/github/saicone/settings/badge?style=flat-square"/>
<img src="https://img.shields.io/codefactor/grade/github/saicone/settings?style=flat-square&logo=codefactor&logoColor=white&label=codefactor&color=00b16a"/>
</a>
<a href="https://github.com/saicone/settings">
<img src="https://img.shields.io/github/languages/code-size/saicone/settings?logo=github&logoColor=white&style=flat-square"/>
</a>
<a href="https://jitpack.io/#com.saicone/settings">
<img src="https://jitpack.io/v/com.saicone/settings.svg?style=flat-square"/>
<img src="https://img.shields.io/github/v/tag/saicone/settings?style=flat-square&logo=jitpack&logoColor=white&label=JitPack&color=brigthgreen"/>
</a>
<a href="https://javadoc.saicone.com/settings/">
<img src="https://img.shields.io/badge/JavaDoc-Online-green?style=flat-square"/>
Expand Down
36 changes: 36 additions & 0 deletions src/main/java/com/saicone/settings/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,67 @@
import java.util.Map;
import java.util.function.Supplier;

/**
* Class that represent flexible configuration itself.
*
* @author Rubenicos
*/
public class Settings extends MapNode {

private SettingsMemory memory;

/**
* Constructs an empty settings object.<br>
* By default, key insertion order will be maintained.
*/
public Settings() {
this(new LinkedHashMap<>());
}

/**
* Constructs a settings object with the given map type.
*
* @param nodes the map to save nodes into.
*/
public Settings(@NotNull Map<String, SettingsNode> nodes) {
super(null, null, nodes);
}

/**
* Constructs an empty settings object with given memory.<br>
* By default, key insertion order will be maintained.
*
* @param memory the memory to save node path ids.
*/
public Settings(@Nullable SettingsMemory memory) {
this(new LinkedHashMap<>(), memory);
}

/**
* Constructs a settings with the given parameters.
*
* @param nodes the map to save nodes into.
* @param memory the memory to save node path ids.
*/
public Settings(@NotNull Map<String, SettingsNode> nodes, @Nullable SettingsMemory memory) {
super(null, null, nodes);
this.memory = memory;
}

/**
* Check if the settings instance is memorizing node path ids.
*
* @return true if any memory instance is been used.
*/
public boolean isMemorizing() {
return this.memory != null;
}

/**
* Get the instance that save path ids.
*
* @return a settings memory instance.
*/
@Nullable
public SettingsMemory getMemory() {
return memory;
Expand Down
Loading

0 comments on commit 0dfdb60

Please sign in to comment.