Category "java"

From snake_case to camelCase in Java

Can anyone tell me how to convert a string in snake_case as: camel_case to a string in camelCase as: camelCase in Java? Thank you in advance.

@ConfigurationProperties on fields

When defining properties with @ConfigurationProperties, can I define the prefix of a specific field instead of the whole class? For example, let's say we have

Why is future.get() always timing out for Volley RequestFuture?

I am trying to make a synchronous Volley networking request. I am using request futures to wait on a response, but the future.get() call always times out (no ma

Automatically trim trailing white space for properties in properties file

Spring doesn't trim the values given in properties file. As per the discussion here, it looks like they have kept in intentionally. However, in our project, we

OutputStreamWriter.append not appending text to a text file Android Programming

File file; FileOutputStream fileOutputStream; final Intent mainIntent = new Intent(Intent.ACTION_MAIN, null); mainIntent.addCategory(Intent.CAT

Printing Unicode Characters in Java - PrintWriter

I am developing a card game in Java and I am currently using a command line to interact and display outputs of the game. I have been representing each card suit

Calling of camera from different thread

I am writing a code that should capture images and send it to a python server. One part of this code requires calling the camera. My solution for this was to si

How to remove an element from a Set inside a Page of items based on a Condition using Java 8

I have a Page of Farmers coming from a JPA repository call findAll method. Each Farmer consists of a Set of Farms which are also coming in the repository call l

Android Audio fingerprinting implementation

I am working on an Android app that works similar to shazam, soundhound, etc. I am using Echoprint for Android w/ source found on GitHub for implmentation of so

String input of weekdays in German to Localdate

I have a string input of weekdays in German and need to get the next Localdate after today which corresponds to the given weekday string. If for example the inp

Old javax libraries compatibility with jakarta

I updated my java project with the latest Java JDK and Tomcat 10. The new libraries use jakarta and you need to rename all your javax. to jakarta... The librari

How to get value from a disabled text field when the value is not present in ID or in any attribute using Java in Selenium WebDriver

I have a few disabled text field auto-populated with some values based on my previous input. I want to verify whether auto-populated values are as per my previo

How to use #pact maven plugin to verify a provider without port

Per https://docs.pact.io/implementation_guides/jvm/provider/maven/#2-define-the-pacts-between-your-consumers-and-providers : Protocol, Host, and Port are requir

Get StateContext in @OnTransition annotated method

In the Spring Statemachine reference doc is this sample code: @WithStateMachine static class Bean1 { @OnTransition(source = "S1", target = "S2") publi

Could not transfer artifacts from/to central maven repo when using Spring Framework Cloud

I am trying to create a maven project using Spring Framework Cloud. I defined pom.xml file as below <parent> <groupId>org.springframework.

Unresolved compilation problem exception using JOptionPane

I am a beginner in Java and I am trying to use JOptionPane to display a message box but keep getting stuck with an error which I cannot figure out. This is my c

Could not transfer artifacts from/to central maven repo when using Spring Framework Cloud

I am trying to create a maven project using Spring Framework Cloud. I defined pom.xml file as below <parent> <groupId>org.springframework.

Merging 4 sorted Arrays into one

I have this method to merge 2 sorted arrays into one sorted array: public void merge(T[] a, int l1, int r1, T[] b, int l2, int r2, T[] c, int l3) {

Unresolved compilation problem exception using JOptionPane

I am a beginner in Java and I am trying to use JOptionPane to display a message box but keep getting stuck with an error which I cannot figure out. This is my c

FindIterable<Document> how to get total records in a result of a query

I was using mongo driver for java 2.x and passed to 3.1. DBCursor is deprecated and I had to use the FindIterable<Document> structure. When I perform a q