Link to home
Start Free TrialLog in
Avatar of jaggernat
jaggernat

asked on

converting string[ ] to object[ ]

hi guys

I have a String[ ] (string array) and CodeObjectVO[ ] (object array)


CodeObject.java contains

public String id = null;
public String description = null;
public String type = null;

and their corresponding

get() methods
set() methods



now i have this code

String[] activeEnv =  System.getActiveEnvironments();
 ( activeEnv   returns [T1, T2]  )

CodeObjectVO[] codeVOarray = null;

how do i convert activeEnv  to CodeObjectVO[ ]. any idea?
My requirment is

CodeObjectVO[] codeVOarray =  Convert 'activeEnv' to CodeObjectVO[].


any idea how i can do this

thanks
J

Avatar of Kevin Cross
Kevin Cross
Flag of United States of America image

Do those activeEnv strings correlate to a specific field in CodeObjectVO like the id?
ASKER CERTIFIED SOLUTION
Avatar of Kevin Cross
Kevin Cross
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jaggernat
jaggernat

ASKER

>>Do those activeEnv strings correlate to a specific field in CodeObjectVO like the id?

yes

.
My example should work OK then.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
the code helped.
thank you.
>> ( activeEnv   returns [T1, T2]  )

So do we take it that none of those values can be, or is ever, repeated?
the solution helped cehj,
thank you.

You are welcome, jaggernat.

Happy coding!

Best regards,
Kevin