Skip to content

Commit 1aaa95e

Browse files
committed
0.12.0 - Added StringCompare.containsCount() and containsIgnoreCaseCount() and overloads, renamed StringSearchOpt.EXACT -> EQUALS, removed final modifiers from classes and static methods, additional unit tests.
1 parent 0e025e4 commit 1aaa95e

29 files changed

+862
-381
lines changed

.classpath

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<classpath>
33
<classpathentry kind="src" path="src"/>
44
<classpathentry kind="src" path="test"/>
5-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jre-9.0.1">
5+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
66
<attributes>
77
<attribute name="module" value="true"/>
88
<attribute name="limit-modules" value="java.se,java.xml.ws.annotation"/>

CHANGELOG.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,19 @@ This project does its best to adhere to [Semantic Versioning](http://semver.org/
44

55

66
--------
7-
### [0.11.5](N/A) - 2019-02-02
7+
### [0.12.0](N/A) - 2019-04-04
8+
#### Added
9+
* `StringCompare.containsCount()`, `containsIgnoreCaseCount()` and overloads
10+
11+
#### Changed
12+
* Renamed `StringSearchOpt.EXACT` -> `EQUALS`
13+
* Removed `final` modifier from classes and static methods
14+
* Ensured all classes containing only static methods, have a private default constructor which throws `AssertionError`
15+
* Additional unit tests
16+
17+
18+
--------
19+
### [0.11.5](https://github.com/TeamworkGuy2/JTextUtil/commit/0e025e4ac7fcb5cff0dae9c282281b99293c1aec) - 2019-02-02
820
#### Added
921
* `StringCompare.containsAny(String, Iterable)`
1022
* `StringCompare.containsAll()` to mirror `containsAny()`
@@ -18,7 +30,6 @@ This project does its best to adhere to [Semantic Versioning](http://semver.org/
1830
* `StringCompare.equal()` error when str2 is shorter than `str2Off + len`, correctly returns false now
1931

2032

21-
2233
--------
2334
### [0.11.4](https://github.com/TeamworkGuy2/JTextUtil/commit/06d67ab9b738d78580688270eaf1e09db8fda339) - 2017-12-22
2435
#### Fixed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
JTextUtil
22
==============
3-
version: 0.11.5
43

54
Dependencies: none
65

bin/jtext_util-with-tests.jar

5 KB
Binary file not shown.

bin/jtext_util.jar

-5.28 KB
Binary file not shown.

package-lib.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version" : "0.11.5",
2+
"version" : "0.12.0",
33
"name" : "jtext-util",
44
"description" : "String search, replace, and transform functions that provide more control, at the trade-off of verbosity, than those already in the Java API",
55
"homepage" : "https://github.com/TeamworkGuy2/JTextUtil",

src/twg2/text/stringEscape/StringEscape.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* @author TeamworkGuy2
1111
* @since 2014-12-19
1212
*/
13-
public final class StringEscape {
13+
public class StringEscape {
1414

1515
private StringEscape() { throw new AssertionError("cannot instantiate static class StringEscape"); }
1616

src/twg2/text/stringEscape/StringEscapeJson.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,26 @@ public class StringEscapeJson {
1616
* @param str the string to convert
1717
* @return the resulting string, not quoted
1818
*/
19-
public static final String toJsonString(String str) {
19+
public static String toJsonString(String str) {
2020
StringBuilder sb = new StringBuilder();
2121
toJsonString(str, 0, str.length(), sb);
2222
return sb.toString();
2323
}
2424

2525

26-
public static final String toJsonString(String str, int off, int len) {
26+
public static String toJsonString(String str, int off, int len) {
2727
StringBuilder sb = new StringBuilder();
2828
toJsonString(str, off, len, sb);
2929
return sb.toString();
3030
}
3131

3232

33-
public static final void toJsonString(String str, StringBuilder dst) {
33+
public static void toJsonString(String str, StringBuilder dst) {
3434
toJsonString(str, 0, str.length(), dst);
3535
}
3636

3737

38-
public static final void toJsonString(String str, int off, int len, StringBuilder dst) {
38+
public static void toJsonString(String str, int off, int len, StringBuilder dst) {
3939
try {
4040
toJsonString(str, off, len, (Appendable)dst);
4141
} catch (IOException ioe) {
@@ -44,12 +44,12 @@ public static final void toJsonString(String str, int off, int len, StringBuilde
4444
}
4545

4646

47-
public static final void toJsonString(String str, Appendable dst) throws IOException {
47+
public static void toJsonString(String str, Appendable dst) throws IOException {
4848
toJsonString(str, 0, str.length(), dst);
4949
}
5050

5151

52-
public static final void toJsonString(String str, int off, int len, Appendable dst) throws IOException {
52+
public static void toJsonString(String str, int off, int len, Appendable dst) throws IOException {
5353
for(int i = off, size = off + len; i < size; i++) {
5454
char ch = str.charAt(i);
5555
if(ch == '"' || ch == '\\' || ch == '\b' || ch == '\f' || ch == '\n' || ch == '\r' || ch == '\t') {
@@ -68,7 +68,7 @@ public static final void toJsonString(String str, int off, int len, Appendable d
6868
}
6969

7070

71-
public static final void toJsonString(char ch, Appendable dst) throws IOException {
71+
public static void toJsonString(char ch, Appendable dst) throws IOException {
7272
if(ch == '"' || ch == '\\' || ch == '\b' || ch == '\f' || ch == '\n' || ch == '\r' || ch == '\t') {
7373
dst.append('\\');
7474
switch(ch) {
@@ -88,26 +88,26 @@ public static final void toJsonString(char ch, Appendable dst) throws IOExceptio
8888
* @param str the string to convert
8989
* @return the resulting string
9090
*/
91-
public static final String fromJsonString(String str) {
91+
public static String fromJsonString(String str) {
9292
StringBuilder sb = new StringBuilder();
9393
fromJsonString(str, 0, str.length(), sb);
9494
return sb.toString();
9595
}
9696

9797

98-
public static final String fromJsonString(String str, int off, int len) {
98+
public static String fromJsonString(String str, int off, int len) {
9999
StringBuilder sb = new StringBuilder();
100100
fromJsonString(str, off, len, sb);
101101
return sb.toString();
102102
}
103103

104104

105-
public static final void fromJsonString(String str, StringBuilder dst) {
105+
public static void fromJsonString(String str, StringBuilder dst) {
106106
fromJsonString(str, 0, str.length(), dst);
107107
}
108108

109109

110-
public static final void fromJsonString(String str, int off, int len, StringBuilder dst) {
110+
public static void fromJsonString(String str, int off, int len, StringBuilder dst) {
111111
try {
112112
fromJsonString(str, off, len, (Appendable)dst);
113113
} catch (IOException ioe) {
@@ -116,12 +116,12 @@ public static final void fromJsonString(String str, int off, int len, StringBuil
116116
}
117117

118118

119-
public static final void fromJsonString(String str, Appendable dst) throws IOException {
119+
public static void fromJsonString(String str, Appendable dst) throws IOException {
120120
fromJsonString(str, 0, str.length(), dst);
121121
}
122122

123123

124-
public static final void fromJsonString(String str, int off, int len, Appendable dst) throws IOException {
124+
public static void fromJsonString(String str, int off, int len, Appendable dst) throws IOException {
125125
char prevCh = 0;
126126
for(int i = off, size = off + len; i < size; i++) {
127127
char ch = str.charAt(i);

src/twg2/text/stringEscape/StringEscapePartial.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,35 +17,35 @@ public class StringEscapePartial {
1717
// ==== String ====
1818
/** @see #unescapePartialQuoted(String, int, int, char, char, char, char, boolean, Appendable)
1919
*/
20-
public static final int unescapePartialQuoted(String src, int offset, char escapeChar, char quote, char endCh1, StringBuilder dst) {
20+
public static int unescapePartialQuoted(String src, int offset, char escapeChar, char quote, char endCh1, StringBuilder dst) {
2121
return unescapePartialQuoted(src, offset, src.length() - offset, escapeChar, quote, endCh1, endCh1, false, dst);
2222
}
2323

2424

2525
/** @see #unescapePartialQuoted(String, int, int, char, char, char, char, boolean, Appendable)
2626
*/
27-
public static final int unescapePartialQuoted(String src, int offset, char escapeChar, char quote, char endCh1, Appendable dst) throws IOException {
27+
public static int unescapePartialQuoted(String src, int offset, char escapeChar, char quote, char endCh1, Appendable dst) throws IOException {
2828
return unescapePartialQuoted(src, offset, src.length() - offset, escapeChar, quote, endCh1, endCh1, false, dst);
2929
}
3030

3131

3232
/** @see #unescapePartialQuoted(String, int, int, char, char, char, char, boolean, Appendable)
3333
*/
34-
public static final int unescapePartialQuoted(String src, int offset, char escapeChar, char quote, char endCh1, char endCh2, StringBuilder dst) {
34+
public static int unescapePartialQuoted(String src, int offset, char escapeChar, char quote, char endCh1, char endCh2, StringBuilder dst) {
3535
return unescapePartialQuoted(src, offset, src.length() - offset, escapeChar, quote, endCh1, endCh2, false, dst);
3636
}
3737

3838

3939
/** @see #unescapePartialQuoted(String, int, int, char, char, char, char, boolean, Appendable)
4040
*/
41-
public static final int unescapePartialQuoted(String src, int offset, char escapeChar, char quote, char endCh1, char endCh2, Appendable dst) throws IOException {
41+
public static int unescapePartialQuoted(String src, int offset, char escapeChar, char quote, char endCh1, char endCh2, Appendable dst) throws IOException {
4242
return unescapePartialQuoted(src, offset, src.length() - offset, escapeChar, quote, endCh1, endCh2, false, dst);
4343
}
4444

4545

4646
/** @see #unescapePartialQuoted(String, int, int, char, char, char, char, boolean, Appendable)
4747
*/
48-
public static final int unescapePartialQuoted(String src, int offset, int length, char escapeChar, char quote,
48+
public static int unescapePartialQuoted(String src, int offset, int length, char escapeChar, char quote,
4949
char endCh1, char endCh2, boolean throwIfNoEndChar, StringBuilder dst) {
5050
try {
5151
return unescapePartialQuoted(src, offset, length, escapeChar, quote, endCh1, endCh2, throwIfNoEndChar, (Appendable)dst);
@@ -75,7 +75,7 @@ public static final int unescapePartialQuoted(String src, int offset, int length
7575
* @return the index of the {@code endCh1/endCh2} that parsing stopped at, or the length
7676
* of the {@code src} string if no {@code endCh1/endCh2} character was encountered
7777
*/
78-
public static final int unescapePartialQuoted(String src, int offset, int length, char escapeChar, char quote,
78+
public static int unescapePartialQuoted(String src, int offset, int length, char escapeChar, char quote,
7979
char endCh1, char endCh2, boolean throwIfNoEndChar, Appendable dst) throws IOException {
8080
final int offLen = offset + length;
8181
boolean added = false;

src/twg2/text/stringEscape/StringEscapeXml.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public static StringBuilder escapeXml(String content, StringBuilder dst) {
7777
* with normal characters
7878
* @see #unescapeXml(String, StringBuilder)
7979
*/
80-
public static final String unescapeXml(String content) {
80+
public static String unescapeXml(String content) {
8181
if(content.indexOf("&") == -1) {
8282
return content;
8383
}

0 commit comments

Comments
 (0)