This repository has been archived by the owner on Mar 5, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
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
11 changed files
with
385 additions
and
16 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
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
118 changes: 118 additions & 0 deletions
118
AbstractPluginFramework/src/main/java/com/djrapitops/plugin/utilities/Format.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,118 @@ | ||
/* | ||
* To change this license header, choose License Headers in Project Properties. | ||
* To change this template file, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
package com.djrapitops.plugin.utilities; | ||
|
||
import java.util.Objects; | ||
|
||
/** | ||
* | ||
* @author Rsl1122 | ||
* @since 2.0.0 | ||
*/ | ||
public class Format { | ||
|
||
public static Format create(String string) { | ||
return new Format(string); | ||
} | ||
|
||
private String string; | ||
|
||
public Format(String string) { | ||
this.string = string; | ||
} | ||
|
||
public Format removeLetters() { | ||
string = FormattingUtils.removeLetters(string); | ||
return this; | ||
} | ||
|
||
public Format removeSymbols() { | ||
string = FormattingUtils.removeSymbols(string); | ||
return this; | ||
} | ||
public Format removeSymbolsButDot() { | ||
string = FormattingUtils.removeSymbolsButDot(string); | ||
return this; | ||
} | ||
public Format removeDot() { | ||
string = string.replaceAll("\\.", ""); | ||
return this; | ||
} | ||
|
||
public Format removeNumbers() { | ||
string = FormattingUtils.removeNumbers(string); | ||
return this; | ||
} | ||
|
||
public Format removeWhitespace() { | ||
string = FormattingUtils.removeWhitespace(string); | ||
return this; | ||
} | ||
|
||
public Format spaceWhatespace() { | ||
string = FormattingUtils.spaceWhitespace(string); | ||
return this; | ||
} | ||
|
||
public Format justNumbers() { | ||
return this.removeLetters().removeSymbols().removeWhitespace(); | ||
} | ||
|
||
public Format justLetters() { | ||
return this.removeNumbers().removeSymbols().removeWhitespace(); | ||
} | ||
|
||
public Format justSymbols() { | ||
return this.removeNumbers().removeLetters().removeWhitespace(); | ||
} | ||
|
||
public Format upperCase() { | ||
string = string.toUpperCase(); | ||
return this; | ||
} | ||
|
||
public Format lowerCase() { | ||
string = string.toLowerCase(); | ||
return this; | ||
} | ||
|
||
public Format capitalize() { | ||
string = (string.charAt(0) + "").toUpperCase() + string.substring(1).toLowerCase(); | ||
return this; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return string; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
int hash = 5; | ||
hash = 67 * hash + Objects.hashCode(this.string); | ||
return hash; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (this == obj) { | ||
return true; | ||
} | ||
if (obj == null) { | ||
return false; | ||
} | ||
if (getClass() != obj.getClass()) { | ||
return false; | ||
} | ||
final Format other = (Format) obj; | ||
if (!Objects.equals(this.string, other.string)) { | ||
return false; | ||
} | ||
return true; | ||
} | ||
|
||
|
||
} |
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
3 changes: 2 additions & 1 deletion
3
AbstractPluginFramework/src/main/java/com/djrapitops/plugin/utilities/player/IPlayer.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
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
Oops, something went wrong.