private void injectParameters ( Object target , Map < String , Option > options ) { ClassStreams . selfAndSupertypes ( target . getClass ( ) ) . forEach ( type -> { for ( Field f : type . getDeclaredFields ( ) ) { Optional . ofNullable ( f . getAnnotation ( CliOption . class ) ) . ifPresent ( opt -> populate ( f , target , getEffectiveValue ( options , opt ) ) ) ; Optional . ofNullable ( f . getAnnotation ( CliOptionGroup . class ) ) . ifPresent ( opt -> populate ( f , target , options ) ) ; } } ) ; }
Inject parameter values from the map of options .