Java Deserialization

Lombok Serialize and Deserialize @Builder Class

Lombok @Builder generates a builder for our class, and Gson serializes and deserializes such a class without extra configuration, whereas Jackson serializes it directly but needs @Jacksonized or @JsonDeserialize to deserialize it. Serialization converts a Java object to JSON, and deserialization converts the JSON back to a Java object. We …

Gson – Serialize and Deserialize a Map

Learn to serialize HashMap using Google Gson library. Also, learn to deserialize JSON string to HashMap containing custom Objects using Gson such that field values are copied into appropriate generic types. These conversions can be used to create deep cloning of the HashMap. 1. Maven Include the latest version of …

JAXB Unmarshaller Example: Convert XML to Java Object

Convert XML to Java objects with the Jakarta XML Binding Unmarshaller. Read XML from a File, String, InputStream or URL. Use JAXBElement for classes without @XmlRootElement, validate against an XSD, map namespaces and move from javax to jakarta.

JAXB: Marshal / Unmarshal a Map in Java

We know that JAXB(Java Architecture for XML Binding) allows Java developers to map Java classes to XML representations. JAXB provides two main features: the ability to marshal Java objects into XML and the inverse, i.e. to unmarshal XML back into Java objects. JAXB mostly is used while implementing webservices or …

About Us

HowToDoInJava provides tutorials and how-to guides on Java and related technologies.

It also shares the best practices, algorithms & solutions and frequently asked interview questions.