Spring Batch Json Item Reader and Writer Example
Learn to read or write the records in a JSON file using Spring Batch JsonItemReader and JsonFileItemWriter implementations.
Learn to read or write the records in a JSON file using Spring Batch JsonItemReader and JsonFileItemWriter implementations.
Learn to read and write XML files using StaxEventItemReader and StaxEventItemWriter classes in a Spring Batch application.
Learn to read all the rows from an Excel (.xls or .xlsx) file using Spring Batch and save them in a database in a Spring Boot application.
In LangChain4j, the AiServices helps in working with strongly typed objects and tasks such as extracting and parsing the structured output in JSON or XML format.
Added in Java 21, the Executors.newVirtualThreadPerTaskExecutor() method returns an Executor that creates a new virtual thread for each task submitted to it.
This Spring Boot tutorial aims at Langchain4j Chat APIs to get started with and run a few examples to give you a high-level understanding.
In Lucene, ByteBuffersDirectory is for pure in-memory access for demos, and MMapDirectory uses memory-mapped files stored in the filesystem.
Spring AI provides 3 inbuilt classes MapOutputConverter, ListOutputConverter, and BeanOutputConverter to help prompt in communicating expected response structures.
This Spring tutorial discusses the basics of Spring AI APIs for image generation using OpenAI’s DALL-E and Stability AI with examples.
This Spring AI tutorial discusses its core terminology and examples to interact with OpenAI’s chat and image generation APIs using simple text prompts.
Learn to write SQL queries with ‘LIKE’ keyword in a Spring Boot JPA application and execute with JdbcClient, JdbcTemplate or JpaRepository template methods.
Learn to create a REST API controller using @RestController in a Spring Boot application, and add method validation, error handling and unit tests.
Learn to Spring Data JPA module and work with JpaRepository interface for performing the CRUD operations in underlying databases in a Spring Boot application.
When rebuilding a Java or Spring application, after upgrading Java 21, you may face the issue “NoSuchFieldError: Class JCTree$JCImport does not have member field”.
Learn to filter a Map by keys or values or both, using the Java 8 Stream filter() and collect() methods with examples.
Learn to create a Java Stream utility class with contains(), containsAll() or containsAny() methods and learn to use them with examples.
Java Stream API provides excellent filtering capability on the elements in the Stream. Sometimes, the stream elements also contain the nested collections; we need to filter those elements in the nested collections. This Java tutorial discusses various approaches with examples to apply filtering on nested collections and collecting the filtered …
Stream mapMulti() is a specialized form of the map() method that transforms each element of a stream into one or multiple output elements or none at all.
Learn to use Java 8 LocalDate and TemporalAdjusters class to get the first and the last day of the current week, month or year with examples.
This short Java tutorial lists two ready-to-use snippets for invoking the default methods in an interface without implementing the interface in a class.
In Java, an identity string is a unique identifier associated with an object instance without calling the overridden toString() or hashCode() methods.
Learn to check if a string starts with, ends with, or both with a specified substring using the regex and built-in methods, and array slicing.
Since Java 8, the java.util.Base64 class provides convenient methods for encoding and decoding files such as text, image, JSON files.
Learn to initialize Java HashMap object in different ways such as empty map, pre-populated map, and collecting stream elements into the map.
A subclass replaces a parent method by overriding it. Learn the override keyword, noImplicitOverride, super calls and the rules the compiler checks.
For each interface, we must write a custom XmlAdapter class that handles the conversion between the value in Java Object and XML string.
In any programming language, naming conventions are a very important best practice to follow. Different parts of a program are written in specific cases so they can communicate easily their purpose in the source code. This short article lists some popular casings such as camel case, pascal case, snake case, …
Learn to solve the error “No default constructor found” when unmarshaling an XML to Java object using JAXB @XmlTransient and @XmlJavaTypeAdapter annotations.
Java 8 Optional contains orElse() and orElseGet() methods that return a default value when the optional is empty. Learn the difference between both.
An interface cannot be instantiated with new, but any object with the right shape matches it. Learn seven ways to create such objects and when to use each.
instanceof checks whether an object was created by a class and narrows its type. Learn how it works, where it fails, and how to check interfaces with in and type guards.
An interface describes a shape and disappears after compilation; a class describes a shape, holds code and exists at runtime. Compare them feature by feature.
TypeScript generics let one function, class or interface work with many types while the compiler checks every value. Examples cover constraints, keyof, defaults and const type parameters.
Extend a TypeScript interface with extends, combine several parents, merge declarations, and learn when an intersection type (&) is the better fit.
A TypeScript interface names the shape of an object. Learn to declare one, use optional and readonly properties, implement it in a class, and choose between an interface and a type alias.
Learn to write Spring Boot RESTs that help in downloading the Excel files (.xlsx) either stored in the server or generating and then sending it.
Learn to split a string in Python from the basic split() method to more advanced approaches such as splitlines() and regex module with examples.
Learn to create generic and custom error pages for specific HTTP error codes in a Spring Boot application with configuration examples.
By leveraging Spring @Import and @ImportResource annotations, we can create more modular, maintainable, and flexible Spring Boot applications.
Spring Boot provides various ways to load property files such as default application.properties, spring profiles, custom property files, environment variables, and system properties.
Learn to create a Spring Boot project with Gradle from scratch, configure the build script, create a Spring Boot application class, and run the application.
Python filter() function provides a concise and readable way to filter elements from a list based on a specified condition. Learn with examples.
Learn to find the most frequent elements in a List or Array using Python that offers several efficient methods to find the most common items
Learn to remove duplicates from a python sequence or list while preserving the original order of the elements using seen set, OrderedDict, Numpy and Pandas.
Python multidict (or multi-dictionary) is a data structure that extends the capabilities of a regular dictionary and allows multiple values for the same key.
This Python tutorial explores different methods to find the largest or smallest N items using built-in sorting, heapq module, and NumPy library.
This tutorial will explore different methods to keep the last N items using the deque from the collections module, standard Python lists, NumPy arrays, and strings.
In this Java tutorial, learn the different approaches for calculating the number of weeks between two dates using the Java Date and Time API.
In this Java tutorial, we will explore various methods to display the name of the day of the week, catering to different scenarios and requirements. Note that we should be careful of using the int values assigned to weekdays as they differ from method to method. 1. Display the Day …
In this Java date-time tutorial, we’ll explore how to split a date-time range into equal intervals. Conceptually, splitting a date-time range into equal intervals involves dividing the entire range into smaller, equally-sized sub-ranges. In short, we need to determine the start and end points of each sub-range. 1. Splitting Date-time …
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.