class HmsGenericUtil {

    public static Object maskPassword( Object obj )
    {
        if ( obj != null )
        {
            if ( obj instanceof HmsNode )
            {
                ServerNode copy = new ServerNode();
                BeanUtils.copyProperties( obj, copy );
                copy.setOsPassword( MASK_DATA );
                copy.setManagementUserPassword( MASK_DATA );
                return copy;
            }
            else if ( obj instanceof SwitchNode )
            {
                SwitchNode copy = new SwitchNode();
                BeanUtils.copyProperties( obj, copy );
                copy.setPassword( MASK_DATA );
                return copy;
            }
        }
        else
        {
            logger.warn( "Null input provided" );
        }
        return null;
    }

}