diff --git a/core-java-8/README.md b/core-java-8/README.md index 6f31a8b886..e0cd0e7c0a 100644 --- a/core-java-8/README.md +++ b/core-java-8/README.md @@ -14,7 +14,6 @@ - [Guide to Java 8 groupingBy Collector](http://www.baeldung.com/java-groupingby-collector) - [Strategy Design Pattern in Java 8](http://www.baeldung.com/java-strategy-pattern) - [Java 8 and Infinite Streams](http://www.baeldung.com/java-inifinite-streams) -- [String Operations with Java Streams](http://www.baeldung.com/java-stream-operations-on-strings) - [Exceptions in Java 8 Lambda Expressions](http://www.baeldung.com/java-lambda-exceptions) - [Java 8 Stream findFirst() vs. findAny()](http://www.baeldung.com/java-stream-findfirst-vs-findany) - [Guide to Java 8 Comparator.comparing()](http://www.baeldung.com/java-8-comparator-comparing) @@ -34,13 +33,11 @@ - [Copy a File with Java](http://www.baeldung.com/java-copy-file) - [Static and Default Methods in Interfaces in Java](http://www.baeldung.com/java-static-default-methods) - [Iterable to Stream in Java](http://www.baeldung.com/java-iterable-to-stream) -- [Converting String to Stream of chars](http://www.baeldung.com/java-string-to-stream) - [How to Iterate Over a Stream With Indices](http://www.baeldung.com/java-stream-indices) - [Efficient Word Frequency Calculator in Java](http://www.baeldung.com/java-word-frequency) - [Primitive Type Streams in Java 8](http://www.baeldung.com/java-8-primitive-streams) - [Fail-Safe Iterator vs Fail-Fast Iterator](http://www.baeldung.com/java-fail-safe-vs-fail-fast-iterator) - [Shuffling Collections In Java](http://www.baeldung.com/java-shuffle-collection) -- [Java 8 StringJoiner](http://www.baeldung.com/java-string-joiner) - [Introduction to Spliterator in Java](http://www.baeldung.com/java-spliterator) - [Java 8 Math New Methods](http://www.baeldung.com/java-8-math) - [Overview of Java Built-in Annotations](http://www.baeldung.com/java-default-annotations) @@ -54,7 +51,6 @@ - [Java 8 Unsigned Arithmetic Support](http://www.baeldung.com/java-unsigned-arithmetic) - [How to Get the Start and the End of a Day using Java](http://www.baeldung.com/java-day-start-end) - [Generalized Target-Type Inference in Java](http://www.baeldung.com/java-generalized-target-type-inference) -- [Image to Base64 String Conversion](http://www.baeldung.com/java-base64-image-string) - [Calculate Age in Java](http://www.baeldung.com/java-get-age) - [Copy a List to Another List in Java](http://www.baeldung.com/java-copy-list-to-another) - [Increment Date in Java](http://www.baeldung.com/java-increment-date) diff --git a/core-java-9/README.md b/core-java-9/README.md index a76dcefc69..8c869f56bb 100644 --- a/core-java-9/README.md +++ b/core-java-9/README.md @@ -17,7 +17,6 @@ - [Java 9 Reactive Streams](http://www.baeldung.com/java-9-reactive-streams) - [How to Get All Dates Between Two Dates?](http://www.baeldung.com/java-between-dates) - [Java 9 java.util.Objects Additions](http://www.baeldung.com/java-9-objects-new) -- [Compact Strings in Java 9](http://www.baeldung.com/java-9-compact-string) - [Convert Date to LocalDate or LocalDateTime and Back](http://www.baeldung.com/java-date-to-localdate-and-localdatetime) - [Java 9 Variable Handles Demistyfied](http://www.baeldung.com/java-variable-handles) - [Exploring the New HTTP Client in Java 9](http://www.baeldung.com/java-9-http-client) diff --git a/core-java/README.md b/core-java/README.md index 6d8db8d388..b35e1d6e35 100644 --- a/core-java/README.md +++ b/core-java/README.md @@ -3,18 +3,14 @@ ## Core Java Cookbooks and Examples ### Relevant Articles: -- [Java – Generate Random String](http://www.baeldung.com/java-random-string) - [Java Timer](http://www.baeldung.com/java-timer-and-timertask) - [How to Run a Shell Command in Java](http://www.baeldung.com/run-shell-command-in-java) - [MD5 Hashing in Java](http://www.baeldung.com/java-md5) - [Guide to Java Reflection](http://www.baeldung.com/java-reflection) - [A Guide to Java Sockets](http://www.baeldung.com/a-guide-to-java-sockets) -- [Convert char to String in Java](http://www.baeldung.com/java-convert-char-to-string) -- [Convert String to int or Integer in Java](http://www.baeldung.com/java-convert-string-to-int-or-integer) - [Java – Try with Resources](http://www.baeldung.com/java-try-with-resources) - [Guide to the Fork/Join Framework in Java](http://www.baeldung.com/java-fork-join) - [How to Print Screen in Java](http://www.baeldung.com/print-screen-in-java) -- [How to Convert String to different data types in Java](http://www.baeldung.com/java-string-conversions) - [Introduction to Java Generics](http://www.baeldung.com/java-generics) - [Generate equals() and hashCode() with Eclipse](http://www.baeldung.com/java-eclipse-equals-and-hashcode) - [A Guide To Java Regular Expressions API](http://www.baeldung.com/regular-expressions-java) @@ -37,8 +33,6 @@ - [A Quick JUnit vs TestNG Comparison](http://www.baeldung.com/junit-vs-testng) - [Java Primitive Conversions](http://www.baeldung.com/java-primitive-conversions) - [Java Money and the Currency API](http://www.baeldung.com/java-money-and-currency) -- [Converting Strings to Enums in Java](http://www.baeldung.com/java-string-to-enum) -- [Quick Guide to the Java StringTokenizer](http://www.baeldung.com/java-stringtokenizer) - [JVM Log Forging](http://www.baeldung.com/jvm-log-forging) - [Guide to sun.misc.Unsafe](http://www.baeldung.com/java-unsafe) - [How to Perform a Simple HTTP Request in Java](http://www.baeldung.com/java-http-request) @@ -55,28 +49,22 @@ - [How to Copy an Array in Java](http://www.baeldung.com/java-array-copy) - [Period and Duration in Java](http://www.baeldung.com/java-period-duration) - [Converting a Stack Trace to a String in Java](http://www.baeldung.com/java-stacktrace-to-string) -- [Count Occurrences of a Char in a String](http://www.baeldung.com/java-count-chars) - [Java Double Brace Initialization](http://www.baeldung.com/java-double-brace-initialization) - [The StackOverflowError in Java](http://www.baeldung.com/java-stack-overflow-error) -- [Split a String in Java](http://www.baeldung.com/java-split-string) - [Introduction to Java Serialization](http://www.baeldung.com/java-serialization) -- [How to Remove the Last Character of a String?](http://www.baeldung.com/java-remove-last-character-of-string) - [ClassNotFoundException vs NoClassDefFoundError](http://www.baeldung.com/java-classnotfoundexception-and-noclassdeffounderror) - [Guide to UUID in Java](http://www.baeldung.com/java-uuid) - [Guide to Escaping Characters in Java RegExps](http://www.baeldung.com/java-regexp-escape-char) - [Guide to hashCode() in Java](http://www.baeldung.com/java-hashcode) - [Difference between URL and URI](http://www.baeldung.com/java-url-vs-uri) - [Broadcasting and Multicasting in Java](http://www.baeldung.com/java-broadcast-multicast) -- [CharSequence vs. String in Java](http://www.baeldung.com/java-char-sequence-string) - [Period and Duration in Java](http://www.baeldung.com/java-period-duration) - [Guide to the Diamond Operator in Java](http://www.baeldung.com/java-diamond-operator) - [“Sneaky Throws” in Java](http://www.baeldung.com/java-sneaky-throws) - [OutOfMemoryError: GC Overhead Limit Exceeded](http://www.baeldung.com/java-gc-overhead-limit-exceeded) -- [StringBuilder and StringBuffer in Java](http://www.baeldung.com/java-string-builder-string-buffer) - [Creating a Java Compiler Plugin](http://www.baeldung.com/java-build-compiler-plugin) - [A Guide to the Static Keyword in Java](http://www.baeldung.com/java-static) - [Initializing Arrays in Java](http://www.baeldung.com/java-initialize-array) -- [Guide to Java String Pool](http://www.baeldung.com/java-string-pool) - [Quick Example - Comparator vs Comparable in Java](http://www.baeldung.com/java-comparator-comparable) - [Quick Guide to Java Stack](http://www.baeldung.com/java-stack) - [The Java continue and break Keywords](http://www.baeldung.com/java-continue-and-break) @@ -102,8 +90,6 @@ - [The Trie Data Structure in Java](http://www.baeldung.com/trie-java) - [Introduction to Javadoc](http://www.baeldung.com/javadoc) - [How to Make a Deep Copy of an Object in Java](http://www.baeldung.com/java-deep-copy) -- [Check if a String is a Palindrome](http://www.baeldung.com/java-palindrome) -- [Comparing Strings in Java](http://www.baeldung.com/java-compare-strings) - [Guide to Inheritance in Java](http://www.baeldung.com/java-inheritance) - [Guide to Externalizable Interface in Java](http://www.baeldung.com/java-externalizable) - [Object Type Casting in Java](http://www.baeldung.com/java-type-casting) @@ -135,11 +121,9 @@ - [Infinite Loops in Java](http://www.baeldung.com/infinite-loops-java) - [Using Java Assertions](http://www.baeldung.com/java-assert) - [Pass-By-Value as a Parameter Passing Mechanism in Java](http://www.baeldung.com/java-pass-by-value-or-pass-by-reference) -- [Check If a String Is Numeric in Java](http://www.baeldung.com/java-check-string-number) - [Variable and Method Hiding in Java](http://www.baeldung.com/java-variable-method-hiding) - [Access Modifiers in Java](http://www.baeldung.com/java-access-modifiers) - [Infinite Loops in Java](http://www.baeldung.com/infinite-loops-java) -- [Why Use char[] Array Over a String for Storing Passwords in Java?](http://www.baeldung.com/java-storing-passwords) - [Introduction to Creational Design Patterns](http://www.baeldung.com/creational-design-patterns) - [Proxy, Decorator, Adapter and Bridge Patterns](http://www.baeldung.com/java-structural-design-patterns) - [Singletons in Java](http://www.baeldung.com/java-singleton) @@ -153,7 +137,6 @@ - [Importance of Main Manifest Attribute in a Self-Executing JAR](http://www.baeldung.com/java-jar-executable-manifest-main-class) - [Extracting Year, Month and Day from Date in Java](http://www.baeldung.com/java-year-month-day) - [Get Date Without Time in Java](http://www.baeldung.com/java-date-without-time) -- [Convert a String to Title Case](http://www.baeldung.com/java-string-title-case) - [How to Get the File Extension of a File in Java](http://www.baeldung.com/java-file-extension) - [Immutable Objects in Java](http://www.baeldung.com/java-immutable-object) - [Console I/O in Java](http://www.baeldung.com/java-console-input-output) diff --git a/core-java/pom.xml b/core-java/pom.xml index b4c9dd285f..477a01375d 100644 --- a/core-java/pom.xml +++ b/core-java/pom.xml @@ -137,11 +137,6 @@ mail ${javax.mail.version} - - com.ibm.icu - icu4j - ${icu4j.version} - org.apache.tika diff --git a/java-strings/README.md b/java-strings/README.md new file mode 100644 index 0000000000..d5b9b45b20 --- /dev/null +++ b/java-strings/README.md @@ -0,0 +1,27 @@ +========= + +## Java Strings Cookbooks and Examples + +### Relevant Articles: +- [String Operations with Java Streams](http://www.baeldung.com/java-stream-operations-on-strings) +- [Converting String to Stream of chars](http://www.baeldung.com/java-string-to-stream) +- [Java 8 StringJoiner](http://www.baeldung.com/java-string-joiner) +- [Image to Base64 String Conversion](http://www.baeldung.com/java-base64-image-string) +- [Java – Generate Random String](http://www.baeldung.com/java-random-string) +- [Convert char to String in Java](http://www.baeldung.com/java-convert-char-to-string) +- [Convert String to int or Integer in Java](http://www.baeldung.com/java-convert-string-to-int-or-integer) +- [How to Convert String to different data types in Java](http://www.baeldung.com/java-string-conversions) +- [Converting Strings to Enums in Java](http://www.baeldung.com/java-string-to-enum) +- [Quick Guide to the Java StringTokenizer](http://www.baeldung.com/java-stringtokenizer) +- [Count Occurrences of a Char in a String](http://www.baeldung.com/java-count-chars) +- [Split a String in Java](http://www.baeldung.com/java-split-string) +- [How to Remove the Last Character of a String?](http://www.baeldung.com/java-remove-last-character-of-string) +- [CharSequence vs. String in Java](http://www.baeldung.com/java-char-sequence-string) +- [StringBuilder and StringBuffer in Java](http://www.baeldung.com/java-string-builder-string-buffer) +- [Guide to Java String Pool](http://www.baeldung.com/java-string-pool) +- [Check if a String is a Palindrome](http://www.baeldung.com/java-palindrome) +- [Comparing Strings in Java](http://www.baeldung.com/java-compare-strings) +- [Check If a String Is Numeric in Java](http://www.baeldung.com/java-check-string-number) +- [Why Use char[] Array Over a String for Storing Passwords in Java?](http://www.baeldung.com/java-storing-passwords) +- [Convert a String to Title Case](http://www.baeldung.com/java-string-title-case) +- [Compact Strings in Java 9](http://www.baeldung.com/java-9-compact-string) \ No newline at end of file diff --git a/java-strings/pom.xml b/java-strings/pom.xml new file mode 100644 index 0000000000..c145fd4070 --- /dev/null +++ b/java-strings/pom.xml @@ -0,0 +1,174 @@ + + 4.0.0 + com.baeldung + java-strings + 0.1.0-SNAPSHOT + jar + java-strings + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../parent-java + + + + + org.apache.commons + commons-collections4 + ${commons-collections4.version} + + + commons-io + commons-io + ${commons-io.version} + + + org.apache.commons + commons-lang3 + ${commons-lang3.version} + + + log4j + log4j + ${log4j.version} + + + commons-codec + commons-codec + ${commons-codec.version} + + + org.projectlombok + lombok + ${lombok.version} + provided + + + + org.assertj + assertj-core + ${assertj.version} + test + + + com.jayway.awaitility + awaitility + ${avaitility.version} + test + + + org.openjdk.jmh + jmh-core + ${jmh-core.version} + + + org.openjdk.jmh + jmh-generator-annprocess + ${jmh-generator.version} + + + org.openjdk.jmh + jmh-generator-bytecode + ${jmh-generator.version} + + + com.codepoetics + protonpack + ${protonpack.version} + + + io.vavr + vavr + ${vavr.version} + + + one.util + streamex + ${streamex.version} + + + joda-time + joda-time + ${joda.version} + + + org.aspectj + aspectjrt + ${asspectj.version} + + + org.aspectj + aspectjweaver + ${asspectj.version} + + + com.ibm.icu + icu4j + ${icu4j.version} + + + + + java-strings + + + src/main/resources + true + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-dependencies + prepare-package + + copy-dependencies + + + ${project.build.directory}/libs + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.8 + 1.8 + -parameters + + + + + + + + 3.5 + 4.1 + 4.01 + 1.10 + 1.16.12 + 0.9.0 + 1.13 + 0.6.5 + 2.10 + + 3.6.1 + 1.8.9 + 1.7.0 + 1.19 + 1.19 + 61.1 + + + \ No newline at end of file diff --git a/core-java/src/main/java/com/baeldung/datetime/UseLocalDateTime.java b/java-strings/src/main/java/com/baeldung/datetime/UseLocalDateTime.java similarity index 100% rename from core-java/src/main/java/com/baeldung/datetime/UseLocalDateTime.java rename to java-strings/src/main/java/com/baeldung/datetime/UseLocalDateTime.java diff --git a/core-java-9/src/main/java/com/baeldung/java9/compactstring/CompactStringDemo.java b/java-strings/src/main/java/com/baeldung/java9/compactstring/CompactStringDemo.java similarity index 100% rename from core-java-9/src/main/java/com/baeldung/java9/compactstring/CompactStringDemo.java rename to java-strings/src/main/java/com/baeldung/java9/compactstring/CompactStringDemo.java diff --git a/core-java-8/src/main/java/com/baeldung/string/JoinerSplitter.java b/java-strings/src/main/java/com/baeldung/string/JoinerSplitter.java similarity index 100% rename from core-java-8/src/main/java/com/baeldung/string/JoinerSplitter.java rename to java-strings/src/main/java/com/baeldung/string/JoinerSplitter.java diff --git a/core-java/src/main/java/com/baeldung/string/Palindrome.java b/java-strings/src/main/java/com/baeldung/string/Palindrome.java similarity index 100% rename from core-java/src/main/java/com/baeldung/string/Palindrome.java rename to java-strings/src/main/java/com/baeldung/string/Palindrome.java diff --git a/core-java/src/main/java/com/baeldung/string/StringBufferStringBuilder.java b/java-strings/src/main/java/com/baeldung/string/StringBufferStringBuilder.java similarity index 96% rename from core-java/src/main/java/com/baeldung/string/StringBufferStringBuilder.java rename to java-strings/src/main/java/com/baeldung/string/StringBufferStringBuilder.java index 74f489d57f..72af4a9aee 100644 --- a/core-java/src/main/java/com/baeldung/string/StringBufferStringBuilder.java +++ b/java-strings/src/main/java/com/baeldung/string/StringBufferStringBuilder.java @@ -1,46 +1,46 @@ -package com.baeldung.string; - -import org.openjdk.jmh.annotations.Benchmark; -import org.openjdk.jmh.annotations.Scope; -import org.openjdk.jmh.annotations.State; -import org.openjdk.jmh.runner.Runner; -import org.openjdk.jmh.runner.RunnerException; -import org.openjdk.jmh.runner.options.Options; -import org.openjdk.jmh.runner.options.OptionsBuilder; - -public class StringBufferStringBuilder { - - public static void main(String[] args) throws RunnerException { - - Options opt = new OptionsBuilder() - .include(StringBufferStringBuilder.class.getSimpleName()) - .build(); - - new Runner(opt).run(); - } - - @State(Scope.Benchmark) - public static class MyState { - int iterations = 1000; - String initial = "abc"; - String suffix = "def"; - } - - @Benchmark - public StringBuffer benchmarkStringBuffer(MyState state) { - StringBuffer stringBuffer = new StringBuffer(state.initial); - for (int i = 0; i < state.iterations; i++) { - stringBuffer.append(state.suffix); - } - return stringBuffer; - } - - @Benchmark - public StringBuilder benchmarkStringBuilder(MyState state) { - StringBuilder stringBuilder = new StringBuilder(state.initial); - for (int i = 0; i < state.iterations; i++) { - stringBuilder.append(state.suffix); - } - return stringBuilder; - } +package com.baeldung.string; + +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.runner.Runner; +import org.openjdk.jmh.runner.RunnerException; +import org.openjdk.jmh.runner.options.Options; +import org.openjdk.jmh.runner.options.OptionsBuilder; + +public class StringBufferStringBuilder { + + public static void main(String[] args) throws RunnerException { + + Options opt = new OptionsBuilder() + .include(StringBufferStringBuilder.class.getSimpleName()) + .build(); + + new Runner(opt).run(); + } + + @State(Scope.Benchmark) + public static class MyState { + int iterations = 1000; + String initial = "abc"; + String suffix = "def"; + } + + @Benchmark + public StringBuffer benchmarkStringBuffer(MyState state) { + StringBuffer stringBuffer = new StringBuffer(state.initial); + for (int i = 0; i < state.iterations; i++) { + stringBuffer.append(state.suffix); + } + return stringBuffer; + } + + @Benchmark + public StringBuilder benchmarkStringBuilder(MyState state) { + StringBuilder stringBuilder = new StringBuilder(state.initial); + for (int i = 0; i < state.iterations; i++) { + stringBuilder.append(state.suffix); + } + return stringBuilder; + } } \ No newline at end of file diff --git a/core-java/src/main/java/com/baeldung/string/StringHelper.java b/java-strings/src/main/java/com/baeldung/string/StringHelper.java similarity index 100% rename from core-java/src/main/java/com/baeldung/string/StringHelper.java rename to java-strings/src/main/java/com/baeldung/string/StringHelper.java diff --git a/core-java/src/main/java/com/baeldung/string/TitleCaseConverter.java b/java-strings/src/main/java/com/baeldung/string/TitleCaseConverter.java similarity index 97% rename from core-java/src/main/java/com/baeldung/string/TitleCaseConverter.java rename to java-strings/src/main/java/com/baeldung/string/TitleCaseConverter.java index 0fdda86f2a..81043f6dac 100644 --- a/core-java/src/main/java/com/baeldung/string/TitleCaseConverter.java +++ b/java-strings/src/main/java/com/baeldung/string/TitleCaseConverter.java @@ -1,12 +1,13 @@ package com.baeldung.string; -import com.ibm.icu.lang.UCharacter; -import com.ibm.icu.text.BreakIterator; -import org.apache.commons.lang.WordUtils; - import java.util.Arrays; import java.util.stream.Collectors; +import org.apache.commons.lang3.text.WordUtils; + +import com.ibm.icu.lang.UCharacter; +import com.ibm.icu.text.BreakIterator; + public class TitleCaseConverter { private static final String WORD_SEPARATOR = " "; diff --git a/core-java/src/main/java/com/baeldung/stringisnumeric/Benchmarking.java b/java-strings/src/main/java/com/baeldung/stringisnumeric/Benchmarking.java similarity index 100% rename from core-java/src/main/java/com/baeldung/stringisnumeric/Benchmarking.java rename to java-strings/src/main/java/com/baeldung/stringisnumeric/Benchmarking.java diff --git a/core-java/src/main/java/com/baeldung/stringisnumeric/IsNumeric.java b/java-strings/src/main/java/com/baeldung/stringisnumeric/IsNumeric.java similarity index 100% rename from core-java/src/main/java/com/baeldung/stringisnumeric/IsNumeric.java rename to java-strings/src/main/java/com/baeldung/stringisnumeric/IsNumeric.java diff --git a/core-java/src/main/java/com/baeldung/stringisnumeric/IsNumericDriver.java b/java-strings/src/main/java/com/baeldung/stringisnumeric/IsNumericDriver.java similarity index 100% rename from core-java/src/main/java/com/baeldung/stringisnumeric/IsNumericDriver.java rename to java-strings/src/main/java/com/baeldung/stringisnumeric/IsNumericDriver.java diff --git a/core-java/src/main/java/com/baeldung/stringtokenizer/MyTokenizer.java b/java-strings/src/main/java/com/baeldung/stringtokenizer/MyTokenizer.java similarity index 100% rename from core-java/src/main/java/com/baeldung/stringtokenizer/MyTokenizer.java rename to java-strings/src/main/java/com/baeldung/stringtokenizer/MyTokenizer.java diff --git a/core-java/src/main/resources/data.csv b/java-strings/src/main/resources/data.csv similarity index 100% rename from core-java/src/main/resources/data.csv rename to java-strings/src/main/resources/data.csv diff --git a/java-strings/src/main/resources/logback.xml b/java-strings/src/main/resources/logback.xml new file mode 100644 index 0000000000..7d900d8ea8 --- /dev/null +++ b/java-strings/src/main/resources/logback.xml @@ -0,0 +1,13 @@ + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + \ No newline at end of file diff --git a/core-java/src/test/java/com/baeldung/CharArrayToStringUnitTest.java b/java-strings/src/test/java/com/baeldung/CharArrayToStringUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/CharArrayToStringUnitTest.java rename to java-strings/src/test/java/com/baeldung/CharArrayToStringUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/CharToStringUnitTest.java b/java-strings/src/test/java/com/baeldung/CharToStringUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/CharToStringUnitTest.java rename to java-strings/src/test/java/com/baeldung/CharToStringUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/StringToCharArrayUnitTest.java b/java-strings/src/test/java/com/baeldung/StringToCharArrayUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/StringToCharArrayUnitTest.java rename to java-strings/src/test/java/com/baeldung/StringToCharArrayUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/StringToIntOrIntegerUnitTest.java b/java-strings/src/test/java/com/baeldung/StringToIntOrIntegerUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/StringToIntOrIntegerUnitTest.java rename to java-strings/src/test/java/com/baeldung/StringToIntOrIntegerUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/chararraypassword/PasswordStoreExamplesUnitTest.java b/java-strings/src/test/java/com/baeldung/chararraypassword/PasswordStoreExamplesUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/chararraypassword/PasswordStoreExamplesUnitTest.java rename to java-strings/src/test/java/com/baeldung/chararraypassword/PasswordStoreExamplesUnitTest.java diff --git a/core-java-8/src/test/java/com/baeldung/fileToBase64StringConversion/FileToBase64StringConversionUnitTest.java b/java-strings/src/test/java/com/baeldung/fileToBase64StringConversion/FileToBase64StringConversionUnitTest.java similarity index 100% rename from core-java-8/src/test/java/com/baeldung/fileToBase64StringConversion/FileToBase64StringConversionUnitTest.java rename to java-strings/src/test/java/com/baeldung/fileToBase64StringConversion/FileToBase64StringConversionUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/java/conversion/README.md b/java-strings/src/test/java/com/baeldung/java/conversion/README.md similarity index 100% rename from core-java/src/test/java/com/baeldung/java/conversion/README.md rename to java-strings/src/test/java/com/baeldung/java/conversion/README.md diff --git a/core-java/src/test/java/com/baeldung/java/conversion/StringConversionUnitTest.java b/java-strings/src/test/java/com/baeldung/java/conversion/StringConversionUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/java/conversion/StringConversionUnitTest.java rename to java-strings/src/test/java/com/baeldung/java/conversion/StringConversionUnitTest.java diff --git a/core-java-8/src/test/java/com/baeldung/java8/base64/ApacheCommonsEncodeDecodeUnitTest.java b/java-strings/src/test/java/com/baeldung/java8/base64/ApacheCommonsEncodeDecodeUnitTest.java similarity index 100% rename from core-java-8/src/test/java/com/baeldung/java8/base64/ApacheCommonsEncodeDecodeUnitTest.java rename to java-strings/src/test/java/com/baeldung/java8/base64/ApacheCommonsEncodeDecodeUnitTest.java diff --git a/core-java-8/src/test/java/com/baeldung/java8/base64/Java8EncodeDecodeUnitTest.java b/java-strings/src/test/java/com/baeldung/java8/base64/Java8EncodeDecodeUnitTest.java similarity index 100% rename from core-java-8/src/test/java/com/baeldung/java8/base64/Java8EncodeDecodeUnitTest.java rename to java-strings/src/test/java/com/baeldung/java8/base64/Java8EncodeDecodeUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/string/CharSequenceVsStringUnitTest.java b/java-strings/src/test/java/com/baeldung/string/CharSequenceVsStringUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/string/CharSequenceVsStringUnitTest.java rename to java-strings/src/test/java/com/baeldung/string/CharSequenceVsStringUnitTest.java diff --git a/core-java-8/src/test/java/com/baeldung/string/JoinerSplitterUnitTest.java b/java-strings/src/test/java/com/baeldung/string/JoinerSplitterUnitTest.java similarity index 100% rename from core-java-8/src/test/java/com/baeldung/string/JoinerSplitterUnitTest.java rename to java-strings/src/test/java/com/baeldung/string/JoinerSplitterUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/string/PalindromeUnitTest.java b/java-strings/src/test/java/com/baeldung/string/PalindromeUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/string/PalindromeUnitTest.java rename to java-strings/src/test/java/com/baeldung/string/PalindromeUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/string/SplitUnitTest.java b/java-strings/src/test/java/com/baeldung/string/SplitUnitTest.java similarity index 97% rename from core-java/src/test/java/com/baeldung/string/SplitUnitTest.java rename to java-strings/src/test/java/com/baeldung/string/SplitUnitTest.java index 83fd253b97..3859a2b26b 100644 --- a/core-java/src/test/java/com/baeldung/string/SplitUnitTest.java +++ b/java-strings/src/test/java/com/baeldung/string/SplitUnitTest.java @@ -1,12 +1,13 @@ package com.baeldung.string; -import com.google.common.base.Splitter; -import org.apache.commons.lang.StringUtils; -import org.junit.Test; +import static org.assertj.core.api.Assertions.assertThat; import java.util.List; -import static org.assertj.core.api.Assertions.assertThat; +import org.apache.commons.lang3.StringUtils; +import org.junit.Test; + +import com.google.common.base.Splitter; public class SplitUnitTest { diff --git a/core-java/src/test/java/com/baeldung/string/StringComparisonUnitTest.java b/java-strings/src/test/java/com/baeldung/string/StringComparisonUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/string/StringComparisonUnitTest.java rename to java-strings/src/test/java/com/baeldung/string/StringComparisonUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/string/StringHelperUnitTest.java b/java-strings/src/test/java/com/baeldung/string/StringHelperUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/string/StringHelperUnitTest.java rename to java-strings/src/test/java/com/baeldung/string/StringHelperUnitTest.java diff --git a/core-java-8/src/test/java/com/baeldung/string/StringToCharStreamUnitTest.java b/java-strings/src/test/java/com/baeldung/string/StringToCharStreamUnitTest.java similarity index 100% rename from core-java-8/src/test/java/com/baeldung/string/StringToCharStreamUnitTest.java rename to java-strings/src/test/java/com/baeldung/string/StringToCharStreamUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/string/StringUnitTest.java b/java-strings/src/test/java/com/baeldung/string/StringUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/string/StringUnitTest.java rename to java-strings/src/test/java/com/baeldung/string/StringUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/string/TitleCaseConverterUnitTest.java b/java-strings/src/test/java/com/baeldung/string/TitleCaseConverterUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/string/TitleCaseConverterUnitTest.java rename to java-strings/src/test/java/com/baeldung/string/TitleCaseConverterUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/string/formatter/StringFormatterExampleUnitTest.java b/java-strings/src/test/java/com/baeldung/string/formatter/StringFormatterExampleUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/string/formatter/StringFormatterExampleUnitTest.java rename to java-strings/src/test/java/com/baeldung/string/formatter/StringFormatterExampleUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/stringisnumeric/CoreJavaIsNumericUnitTest.java b/java-strings/src/test/java/com/baeldung/stringisnumeric/CoreJavaIsNumericUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/stringisnumeric/CoreJavaIsNumericUnitTest.java rename to java-strings/src/test/java/com/baeldung/stringisnumeric/CoreJavaIsNumericUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/stringisnumeric/NumberUtilsIsCreatableUnitTest.java b/java-strings/src/test/java/com/baeldung/stringisnumeric/NumberUtilsIsCreatableUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/stringisnumeric/NumberUtilsIsCreatableUnitTest.java rename to java-strings/src/test/java/com/baeldung/stringisnumeric/NumberUtilsIsCreatableUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/stringisnumeric/NumberUtilsIsParsableUnitTest.java b/java-strings/src/test/java/com/baeldung/stringisnumeric/NumberUtilsIsParsableUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/stringisnumeric/NumberUtilsIsParsableUnitTest.java rename to java-strings/src/test/java/com/baeldung/stringisnumeric/NumberUtilsIsParsableUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/stringisnumeric/RegularExpressionsUnitTest.java b/java-strings/src/test/java/com/baeldung/stringisnumeric/RegularExpressionsUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/stringisnumeric/RegularExpressionsUnitTest.java rename to java-strings/src/test/java/com/baeldung/stringisnumeric/RegularExpressionsUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/stringisnumeric/StringUtilsIsNumericSpaceUnitTest.java b/java-strings/src/test/java/com/baeldung/stringisnumeric/StringUtilsIsNumericSpaceUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/stringisnumeric/StringUtilsIsNumericSpaceUnitTest.java rename to java-strings/src/test/java/com/baeldung/stringisnumeric/StringUtilsIsNumericSpaceUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/stringisnumeric/StringUtilsIsNumericUnitTest.java b/java-strings/src/test/java/com/baeldung/stringisnumeric/StringUtilsIsNumericUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/stringisnumeric/StringUtilsIsNumericUnitTest.java rename to java-strings/src/test/java/com/baeldung/stringisnumeric/StringUtilsIsNumericUnitTest.java diff --git a/core-java-8/src/test/java/com/baeldung/stringjoiner/StringJoinerUnitTest.java b/java-strings/src/test/java/com/baeldung/stringjoiner/StringJoinerUnitTest.java similarity index 100% rename from core-java-8/src/test/java/com/baeldung/stringjoiner/StringJoinerUnitTest.java rename to java-strings/src/test/java/com/baeldung/stringjoiner/StringJoinerUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/stringpool/StringPoolUnitTest.java b/java-strings/src/test/java/com/baeldung/stringpool/StringPoolUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/stringpool/StringPoolUnitTest.java rename to java-strings/src/test/java/com/baeldung/stringpool/StringPoolUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/stringtokenizer/TokenizerUnitTest.java b/java-strings/src/test/java/com/baeldung/stringtokenizer/TokenizerUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/stringtokenizer/TokenizerUnitTest.java rename to java-strings/src/test/java/com/baeldung/stringtokenizer/TokenizerUnitTest.java diff --git a/java-strings/src/test/resources/.gitignore b/java-strings/src/test/resources/.gitignore new file mode 100644 index 0000000000..83c05e60c8 --- /dev/null +++ b/java-strings/src/test/resources/.gitignore @@ -0,0 +1,13 @@ +*.class + +#folders# +/target +/neoDb* +/data +/src/main/webapp/WEB-INF/classes +*/META-INF/* + +# Packaged files # +*.jar +*.war +*.ear \ No newline at end of file diff --git a/core-java-8/src/test/resources/test_image.jpg b/java-strings/src/test/resources/test_image.jpg similarity index 100% rename from core-java-8/src/test/resources/test_image.jpg rename to java-strings/src/test/resources/test_image.jpg diff --git a/pom.xml b/pom.xml index 5a46ae2b19..50d2bbc568 100644 --- a/pom.xml +++ b/pom.xml @@ -342,6 +342,7 @@ azure bootique cdi + java-strings core-java core-java-collections @@ -891,6 +892,7 @@ azure bootique cdi + java-strings core-java-collections core-java-io