Class Replacement
java.lang.Object
de.chojo.jdautil.localization.util.Replacement
-
Method Summary
Modifier and TypeMethodDescriptionaddFormatting(Format... formats) Add formatting codes to the replacement.static ReplacementCreates a new replacement.static ReplacementCreates a new replacement.static ReplacementCreates a new replacement.static ReplacementcreateMention(String key, IMentionable value) Creates a new replacement.static ReplacementcreateMention(TextChannel value) Creates a new replacement.static ReplacementcreateMention(Member value) Creates a new replacement.static ReplacementcreateMention(Role value) Creates a new replacement.static ReplacementcreateMention(User value) Creates a new replacement.static Replacementdeserialize(String key, String value, boolean caseSensitive) booleaninthashCode()Invoke the replacement on the string.Only replace the placeholder when its case matches exactly.toString()
-
Method Details
-
create
Creates a new replacement.- Parameters:
key- key of replacementvalue- value for replacementformats- format which should be applied on the replacement.- Returns:
- replacement with registered replacement
-
deserialize
-
create
Creates a new replacement.- Parameters:
key- key of replacementvalue- value which provides a string viaObject.toString()formats- format which should be applied on the replacement.- Returns:
- replacement with registered replacement
-
create
Creates a new replacement.- Parameters:
key- key of replacementvalue- value which provides the name of the playerformats- format which should be applied on the replacement.- Returns:
- replacement with registered replacement
-
createMention
Creates a new replacement.- Parameters:
value- value which provides the name of the player- Returns:
- replacement with registered replacement
-
createMention
Creates a new replacement.- Parameters:
value- value which provides the name of the player- Returns:
- replacement with registered replacement
-
createMention
Creates a new replacement.- Parameters:
value- value which provides the name of the player- Returns:
- replacement with registered replacement
-
createMention
Creates a new replacement.- Parameters:
value- value which provides the name of the player- Returns:
- replacement with registered replacement
-
createMention
Creates a new replacement.- Parameters:
value- value which provides the name of the player- Returns:
- replacement with registered replacement
-
addFormatting
Add formatting codes to the replacement. A §r will be appended after the replacement. Only provide the formatting character. Without § or &.- Parameters:
formats- formats which should be applied on the replacement.- Returns:
- replacement with formatting set
-
matchCase
Only replace the placeholder when its case matches exactly. By default the case is ignored.- Returns:
- Replacement with value changed
-
invoke
-
equals
-
hashCode
-
toString
-