-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:XDjackieXD/PackUpdate
- Loading branch information
Showing
7 changed files
with
149 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/main/java/at/chaosfield/packupdate/common/DebugFlag.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package at.chaosfield.packupdate.common; | ||
|
||
import scala.Option; | ||
import scala.Some; | ||
|
||
/** | ||
* Debug flags are passed comma-separated via the org.chaosfield.packupdate.debug java property | ||
* Example: java -D org.chaosfield.packupdate.debug=force_refresh -jar PackUpdate.jar | ||
*/ | ||
public enum DebugFlag { | ||
/** | ||
* Pretend that all packages are corrupt and need to be reinstalled | ||
*/ | ||
ForceRefresh("force_refresh") | ||
|
||
; | ||
|
||
public String internalName; | ||
|
||
DebugFlag(String internalName) { | ||
this.internalName = internalName; | ||
} | ||
|
||
public static Option<DebugFlag> fromString(String data) { | ||
for (DebugFlag flag : DebugFlag.values()) { | ||
if (flag.internalName.equals(data)) { | ||
return new Some<>(flag); | ||
} | ||
} | ||
return Option.empty(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters