public static ExecutionPath fromList ( List < ? > objects ) { assertNotNull ( objects ) ; ExecutionPath path = ExecutionPath . rootPath ( ) ; for ( Object object : objects ) { if ( object instanceof Number ) { path = path . segment ( ( ( Number ) object ) . intValue ( ) ) ; } else { path = path . segment ( String . valueOf ( object ) ) ; } } return path ; }
This will create an execution path from the list of objects