private Model doModel ( Type type , Model model ) { Map < String , Property > properties = model . getProperties ( ) ; if ( properties != null ) { BeanDescription desc = Json . mapper ( ) . getSerializationConfig ( ) . introspect ( Json . mapper ( ) . constructType ( type ) ) ; for ( BeanPropertyDefinition beanProperty : desc . findProperties ( ) ) { Property property = properties . get ( beanProperty . getName ( ) ) ; if ( property != null ) { property . setRequired ( beanProperty . isRequired ( ) ) ; } } } return model ; }
Mostly for kotlin null safe operator and immutable properties .