This repository has been archived by the owner on Jan 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
338 additions
and
86 deletions.
There are no files selected for viewing
259 changes: 190 additions & 69 deletions
259
src/main/java/net/flectone/messages/MessageBuilder.java
Large diffs are not rendered by default.
Oops, something went wrong.
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,46 @@ | ||
package net.flectone.messages; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class TextParameters { | ||
|
||
private final String text; | ||
|
||
private final List<String> parameters = new ArrayList<>(); | ||
|
||
public TextParameters(@NotNull String text) { | ||
this.text = text; | ||
} | ||
|
||
public void add(String parameter) { | ||
parameters.add(parameter); | ||
} | ||
|
||
public void add(List<String> parameters) { | ||
if (parameters == null || parameters.isEmpty()) return; | ||
this.parameters.addAll(parameters); | ||
} | ||
|
||
public List<String> getParameters() { | ||
return parameters; | ||
} | ||
|
||
public String getText() { | ||
return text; | ||
} | ||
|
||
public void remove(String parameter) { | ||
parameters.remove(parameter); | ||
} | ||
|
||
public void clear() { | ||
parameters.clear(); | ||
} | ||
|
||
public boolean contains(String parameter) { | ||
return parameters.contains(parameter); | ||
} | ||
} |
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
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