JDOM parser can be used to read XML, parse xml and write XML file after updating content of it. It stores JDOM2 document in memory to read xml values.
AWS (Amazon Web Service) is a cloud computing platform that enables user to access on demand computing services like database storage, virtual cloud server, etc. It works on “pay-as-you-go” model that means – you don’t need to pay upfront for services it offer. You pay for only how much service (mostly bandwidth) you consumed – […]
Learn to read file content into string in java. Examples use Files.readAllBytes, Files.lines and FileReader & BufferedReader to read file content.
Java example to use regular expressions to search and replace unwanted and non-printable characters ASCII characters from text file content.
Java 8 allows to refer method from class or object using class::methodName syntax. Learn about different types of available method references in java 8.
Learn to convert byte to String and String to byte in java – with examples. Conversion between byte array and string may be used in many cases including IO operations, generate secure hashes etc.
Quick references to convert string to int values in java. Included code snippets have examples of converting string values to int or Integer in multiple base or radix. Code snippets to convert string to int Output: 1001 1001 1001 513 513 513 4097 4097 4097 Convert String to int with Integer.parseInt() parseInt() method is overloaded […]
Learn to create enum using strings, iterate over all enum constants, getting single enum value and doing reverse lookup to find enum by string value. Create enum of string constants Example of creating enum with strings. This enum contains deployment environments and their respective URLs. Iterate all enum constants To iterate over all enums, use […]
To convert comma separated string to list in java, you can use below methods. Comma-separated String to List Using Regex You can use regular expression “\\s*,\\s*” to match comma into CSV list and then use String.split() method. Output: [how, to, do, in, java] This resulting List is a fixed-size List backed by the array. It […]
You may need custom serialization in java in may cases. For example, you have legacy java classes which you are not willing to modify for any reason. There can be some design constraints as well. Or even simply, the class is expected to be changed in future releases which could break the deserialization of previously […]