Relative Content

Tag Archive for javainheritanceyamllombokmicronaut

How to use multiple model classes in a method without overloading

In my Java service, I have two model classes with some common variables. The values of those variables are injected from properties.yml file. In the common method below, I want to pass any of the model class and use its methods as example given below. I cannot create multiple commonMethods because they would have same long code just different input model object. So how can I do that?

How to use multiple model classes in a method without overloading

In my Java service, I have two model classes with some common variables. The values of those variables are injected from properties.yml file. In the common method below, I want to pass any of the model class and use its methods as example given below. I cannot create multiple commonMethods because they would have same long code just different input model object. So how can I do that?