-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from CyR1en/development
Add more filters & other features
- Loading branch information
Showing
23 changed files
with
590 additions
and
74 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
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
36 changes: 36 additions & 0 deletions
36
src/main/java/com/cyr1en/commandprompter/api/prompt/InputValidator.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,36 @@ | ||
package com.cyr1en.commandprompter.api.prompt; | ||
|
||
|
||
/** | ||
* A functional interface for validating input. | ||
* | ||
* <p>Implement this interface to create a custom validator for your prompt.</p> | ||
*/ | ||
public interface InputValidator { | ||
|
||
/** | ||
* Validate the input. | ||
* | ||
* <p>Return true if the input is valid, false otherwise.</p> | ||
* | ||
* @param input the input to validate | ||
* @return true if the input is valid, false otherwise | ||
*/ | ||
boolean validate(String input); | ||
|
||
/** | ||
* Get the alias for this validator. | ||
* | ||
* <p>The alias is used to identify the validator.</p> | ||
* | ||
* @return the alias for this validator | ||
*/ | ||
String alias(); | ||
|
||
/** | ||
* Get the message to send when validation fails. | ||
* | ||
* @return the message to send when validation fails | ||
*/ | ||
String messageOnFail(); | ||
} |
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
16 changes: 16 additions & 0 deletions
16
src/main/java/com/cyr1en/commandprompter/hook/hooks/FilterHook.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,16 @@ | ||
package com.cyr1en.commandprompter.hook.hooks; | ||
|
||
import com.cyr1en.commandprompter.prompt.ui.HeadCache; | ||
|
||
/** | ||
* A hook that registers filters to the head cache. | ||
*/ | ||
public interface FilterHook { | ||
|
||
/** | ||
* Register filters to the head cache. | ||
* | ||
* @param headCache the head cache | ||
*/ | ||
void registerFilters(HeadCache headCache); | ||
} |
Oops, something went wrong.