public M keep ( String attr ) { if ( attrs . containsKey ( attr ) ) { // prevent put null value to the newColumns Object keepIt = attrs . get ( attr ) ; boolean keepFlag = _getModifyFlag ( ) . contains ( attr ) ; attrs . clear ( ) ; _getModifyFlag ( ) . clear ( ) ; attrs . put ( attr , keepIt ) ; if ( keepFlag ) _getModifyFlag ( ) . add ( attr ) ; } else { attrs . clear ( ) ; _getModifyFlag ( ) . clear ( ) ; } return ( M ) this ; }
Keep attribute of this model and remove other attributes .