Skip to content
Advertisement

Tag: java

org.mapstruct don’t work with a base class

I have 2 classes. My base class: And my other class. This class extends BaseRequest class. And When I try create a mapper to cast my AddClass to OtherClass: When I run my build I received this error: Error:(22,13) java: No property named “dateTransaction” exists in source parameter(s). Did you mean “null”? Answer MapStruct works without issues with Lombok. However,

How to skip a leading string when scanning text file?

I’m making a program that draws a basic image using instructions from a text file. The format for the instructions is: and this is my code: this is giving a NoSuchElementException. I’m assuming it’s because the fwidth and fheight are taking the leading strings as ints but i can’t figure out how to get the scanner to skip the strings

recyclerview uploads items multiple time on refresh

I have implemented a recyclerview, where I want to show the groups that have been created in the app. Right now I am refreshing the recyclerview using the swipeRefreshLayout, but everytime I refresh the recyclerview, it prints out the same group multiple times according to how many times I refresh it. Can anyone help me solve this problem? Below is

MenuItem doesn’t appear in toolbar

I’m facing a problem. I can’t make a toolbar to show me a menu. I know that this question was asked here previously here, and I went through all possible solutions, but none of them gave me desired result. So I’m using 1 activity and few fragments and I want to show different menu items in a toolbar according to

How to Flip the triangle?

How to flip this triangle? So i was making aritmethic sequance triangle. It was upside down. How do I turn it 180 degree? for example: 1=1 1+2=3 1+2+3=6 etc… my code: Answer You can do it for any n, by getting input from the user

Allow only left aligned zeros using regex

I am fairly new to using regex. I have a serial number which can take the following forms: VV-XXXXXX-P or VVXXXXXXP If the hyphen variant is used, then the number of ‘X’ can be variable. For example 01-162-8 is equivalent to 010001628. In order to identify the 2 formats, I have created the following regex’s: However the issue with the

Advertisement