Learn how to take an InputStream and convert it into a functional Stream in Java.
Search Results for: str
Mapping Enum to String Using MapStruct
A quick tutorial on using MapStruct to convert enums to strings.
Using MapStruct With Inheritance
Learn how to use the Mapstruct mappers with inherited Java bean classes.
Difference Between Lombok @AllArgsConstructor, @RequiredArgsConstructor and @NoArgConstructor
Learn about different constructor generation annotations in Lombok and when to use them.
Print Distinct Characters of a String in Java
Explore various approaches to handling and processing unique characters.
Create HashMap with Character Count of a String in Java
Learn how to create a HashMap with a string’s character count.
Finding the nth Last Occurrence of char in String
Explore different methods to find the nth last occurrence of a character within a string using Java.
Convert String to OffsetDateTime
Learn why converting strings to OffsetDateTime objects is crucial for handling date and time in Java applications.
Difference Between Casting to String and String.valueOf()
Discover when casting to String or using String.valueOf() is most useful.
Print the Default Value When Overriding toString() Method
Learn about overriding the toString() method and handling the potential null within.
Find the Length of the Longest Symmetric Substring
Learn how to handle the symmetric substring expansion methods, taking into account the specific requirements such as input size and computational efficiency.
Mapping Enum With MapStruct
Learn to map between enum types and other data types like strings or integers using MapStruct’s @ValueMapping
Get Last n Characters From a String
Learn a few different ways to get the last n characters from a String.
The @Struct Annotation Type in Hibernate – Structured User-Defined Types
Quick intro to Hibernate’s @Struct annotation to create structured user-defined types.
Java InputStream vs. InputStreamReader
Learn how an InputStreamReader builds on an InputStream to assist when working with streams of characters.
When to Use Setter Methods or Constructors for Setting a Variable’s Value in Java
Learn when to use setter methods or constructors for setting the value of a variable in Java.
Reading a .gz File Line by Line Using GZIPInputStream
Sometimes, we need to read compressed .gz files in Java. Learn to use Java’s built in stream libraries to read from gzip format files.
Flatten a Stream of Maps to a Single Map in Java
Learn to combine a stream of maps into a single result map in Java.
Modify and Print List Items With Java Streams
Learn to modify or transform a Java list and print its new elements.
Remove Only Trailing Spaces or Whitespace From a String in Java
Learn how to strip the trailing whitespace from the end of a String in Java.