public void register ( Task task ) { Optional . ofNullable ( task ) . filter ( t -> t . getTask ( ) != null ) . filter ( t -> StringUtils . hasText ( t . getName ( ) ) ) . ifPresent ( t -> checkTaskMap . put ( t . getName ( ) , t ) ) ; }
Register a health check task .