public static NamespaceDto transformToDto ( Namespace namespace ) { if ( namespace == null ) { throw new WebApplicationException ( "Null entity object cannot be converted to Dto object." , Status . INTERNAL_SERVER_ERROR ) ; } NamespaceDto result = createDtoObject ( NamespaceDto . class , namespace ) ; for ( PrincipalUser user : namespace . getUsers ( ) ) { result . addUsername ( user . getUserName ( ) ) ; } return result ; }
Converts a namespace entity to a DTO .