Learn how to add a new element at a specific position to an ArrayList.
Search Results for: object
Generate Unique ObjectId in MongoDB
A quick and practical guide to generating unique ObjectId in MongoDB.
Mocking Java InputStream Object
A quick and practical guide to mocking InputStream objects in Java.
Insert Array Inside an Object in MongoDB
Learn how to insert an array into a MongoDB object.
Sorting Objects in a List by Date
Learn how to sort a Java Collection by Date object in both ascending and descending modes.
Send a SOAP Object with Feign Client
Learn how to invoke a SOAP web service using Feign.
Set List of Objects in Swagger API Response
Learn how to modify the Swagger API response to deliver a list of objects.
Assert That an Object Is From a Specific Type
In this article, we’ll explore how we can verify that an object is of a specific type. We’ll be looking at different testing libraries and what methods they offer to assert the object type.
Convert an Object to a Byte Array in Java
A quick and practical guide to converting objects into byte arrays in Java.
Hibernate’s “Object References an Unsaved Transient Instance” Error
Learn how to define a proper CascadeType to solve the “org.hibernate.TransientObjectException: object references an unsaved transient instance” error
The DTO Pattern (Data Transfer Object)
Explore the definition of the DTO Pattern and its reason for existing, and how to implement it.
Java Objects.hash() vs Objects.hashCode()
Learn how and when to use the Object.hashCode(), Objects.hashCode() and Objects.hash().
Convert an Array of Primitives to an Array of Objects
Learn to convert an array of primitives to an array of objects.
Get List of JSON Objects with WebClient
Learn how to convert a JSON Array into a Java Array of Object, Array of POJO, and a List of POJO using Spring WebClient
How to Convert a Hibernate Proxy to a Real Entity Object
In this tutorial, we’ll learn how to convert a Hibernate proxy to a real entity object
Spring Boot: Customize the Jackson ObjectMapper
Learn how to configure the serialization and deserialization options for Jackson using Spring Boot.
Get list of JSON objects with Spring RestTemplate
Spring RestTemplate can convert a JSON array to a variety of Java types. We look at the options and how to produce a type-specific list.
Object States in Hibernate’s Session
A quick and practical guide to Hibernate’s Session object states.
Getting Database URL From JDBC Connection Object
Learn how to obtain the database URL from a JDBC Connection object.
Determine if an Object Is of Primitive Type
Learn how to determine if an object is of primitive type using Java.